Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0
-
None
-
Unknown
Description
The test is failed after Spring6 upgrade.
[INFO] Running org.apache.cxf.jaxws.spring.SpringBeansTest [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.716 s <<< FAILURE! - in org.apache.cxf.jaxws.spring.SpringBeansTest [ERROR] org.apache.cxf.jaxws.spring.SpringBeansTest.testCXF3959SpringInject Time elapsed: 0.661 s <<< ERROR! org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl--1761046809': Cannot create inner bean '(inner bean)#338c99c8' of type [org.apache.cxf.jaxws.spring.PostConstructCalledCount] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#338c99c8': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'jakarta.xml.ws.WebServiceContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@jakarta.annotation.Resource(shareable=true, lookup="", name="", description="", authenticationType=CONTAINER, type=java.lang.Object.class, mappedName="")} at org.apache.cxf.jaxws.spring.SpringBeansTest.testCXF3959SpringInject(SpringBeansTest.java:482) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#338c99c8': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'jakarta.xml.ws.WebServiceContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@jakarta.annotation.Resource(shareable=true, lookup="", name="", description="", authenticationType=CONTAINER, type=java.lang.Object.class, mappedName="")} at org.apache.cxf.jaxws.spring.SpringBeansTest.testCXF3959SpringInject(SpringBeansTest.java:482) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'jakarta.xml.ws.WebServiceContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@jakarta.annotation.Resource(shareable=true, lookup="", name="", description="", authenticationType=CONTAINER, type=java.lang.Object.class, mappedName="")} at org.apache.cxf.jaxws.spring.SpringBeansTest.testCXF3959SpringInject(SpringBeansTest.java:482)
Spring5 has this setting in
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
this.ignoreResourceType("javax.xml.ws.WebServiceContext");
but this setting for jakarta.xml.ws.WebServiceContext is removed in Spring6, see
https://github.com/spring-projects/spring-framework/issues/27422
The source code in Spirng5 and Spring6: