Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8666

Spring6 for JSR 250 annotations isn't disabled for jakarta.xml.ws.WebServiceContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.0.1
    • JAX-WS Runtime
    • 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:

      https://github.com/spring-projects/spring-framework/blob/v5.3.16/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java#L207

      https://github.com/spring-projects/spring-framework/blob/v6.0.0-M2/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java#L179

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              ema Jim Ma
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: