cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colm O hEigeartaigh (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CXF-6630) Cannot call setAttribute with a null name
Date Fri, 14 Oct 2016 14:13:21 GMT

     [ https://issues.apache.org/jira/browse/CXF-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Colm O hEigeartaigh closed CXF-6630.
------------------------------------

> Cannot call setAttribute with a null name
> -----------------------------------------
>
>                 Key: CXF-6630
>                 URL: https://issues.apache.org/jira/browse/CXF-6630
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.2, 3.1.3
>            Reporter: Jan Vondrouš
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.7, 3.1.4
>
>
> 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) {
>             return 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message