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

Colm O hEigeartaigh closed CXF-6671.
------------------------------------

> Ambiguous JAXRSServerFactoryBean.setApplication() breaks Spring injection
> -------------------------------------------------------------------------
>
>                 Key: CXF-6671
>                 URL: https://issues.apache.org/jira/browse/CXF-6671
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.7
>            Reporter: Andrew Greenburg
>            Assignee: Sergey Beryozkin
>             Fix For: 3.1.5, 3.0.8, 3.2.0
>
>
> We're using a custom javax.ws.rs.core.Application implementation, 
> "com.foo.BasicApplication", injected via Spring XML into a 
> JAXRSServerFactoryBean. I've been seeing some inconsistent behavior at 
> intialization. About half the time I get this:
> {code}
> WARN  [] [org.springframework.beans.GenericTypeAwarePropertyDescriptor] - 
> Invalid JavaBean property 'application' being accessed! Ambiguous write 
> methods found next to actually used [public void 
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setApplication(javax.ws.rs.core.Application)]:
>  [public void 
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setApplication(org.apache.cxf.jaxrs.model.ApplicationInfo)]
> {code}
> which complains about it, but in this case it still works.
> The other half of the time I get this, and the application fails to start up:
> {code}
> org.springframework.beans.ConversionNotSupportedException: Failed to convert 
> property value of type 'com.foo.BasicApplication' to required type 
> 'org.apache.cxf.jaxrs.model.ApplicationInfo' for property 'application'; 
> nested exception is java.lang.IllegalStateException: Cannot convert value of 
> type [com.foo.BasicApplication] to required type 
> [org.apache.cxf.jaxrs.model.ApplicationInfo] for property 'application': no 
> matching editors or conversion strategy found
>       at 
> org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:591)
>       at 
> org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:603)
>       at 
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:204)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1527)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
>       ... 24 more
> {code}
> Is this not a supported configuration? I found a workaround of creating a 
> wrapper class that proxies the setter call without the ambiguity, but it's 
> not ideal.



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

Reply via email to