Description
After update on version 3.1.2. Our application ends with this Exception
...
Caused by: java.lang.IllegalArgumentException: Cannot call setAttribute with a null name
at org.apache.catalina.connector.Request.setAttribute(Request.java:1500)
at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541)
at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239)
at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239)
at org.apache.cxf.jaxrs.provider.RequestDispatcherProvider.writeTo(RequestDispatcherProvider.java:212)
... 59 more
I believe, that i know where is problem and that fix is really trivial:
Class:
org.apache.cxf.jaxrs.provider.RequestDispatcherProvider
have method
protected String getBeanName(Object bean) {
...
String name = beanNames.get(bean.getClass().getName());
if (name != null)
...
}
This return null and cause exception (stacktrace is above)
Fix should be trivial just change "return null;"
into
"return name;"
I believe, that it is correct fix, because code in version 3.1.1 looked like this:
String name = beanNames.get(bean.getClass().getName());
return name != null ? name : bean.getClass().getSimpleName().toLowerCase();
Thanks for fix, because we want use new version of CXF. And we cannot due to this issue.