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

When publish the endpoint by using Serlvet transport without the spring , get the NPE for injecting the bus resource to JMSTransportFactory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.0.4, 2.0.5
    • Fix Version/s: 2.1.1, 2.0.7
    • Component/s: Transports
    • Labels:
      None

      Description

      public class AbcCxfServlet extends CXFNonSpringServlet {
      
          public void init(ServletConfig servletConfig) throws ServletException {
              super.init(servletConfig);
              Bus bus = this.getBus();
              BusFactory.setDefaultBus(bus);
      	  Endpoint.publish("/users", new HelloWorldImpl());
          }
      }
      

      SEVERE: an AnnotationVisitor (org.apache.cxf.common.injection.ResourceInjector@aeea66) raised an exception on element public void org.apache.cxf.transport.jms.JMSTransportFactory.setBus(org.apache.cxf.Bus).
      java.lang.NullPointerException
      at javax.naming.InitialContext.getURLScheme(InitialContext.java:228)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:277)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.apache.cxf.transport.servlet.ServletContextResourceResolver.resolve(ServletContextResourceResolver.java:62)
      at org.apache.cxf.resource.DefaultResourceManager.findResource(DefaultResourceManager.java:99)
      at org.apache.cxf.resource.DefaultResourceManager.resolveResource(DefaultResourceManager.java:55)
      at org.apache.cxf.common.injection.ResourceInjector.resolveResource(ResourceInjector.java:401)
      at org.apache.cxf.common.injection.ResourceInjector.visitMethod(ResourceInjector.java:185)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.cxf.common.annotation.AnnotationProcessor.visitAnnotatedElement(AnnotationProcessor.java:131)
      at org.apache.cxf.common.annotation.AnnotationProcessor.processMethods(AnnotationProcessor.java:103)
      at org.apache.cxf.common.annotation.AnnotationProcessor.accept(AnnotationProcessor.java:90)
      at org.apache.cxf.common.injection.ResourceInjector.inject(ResourceInjector.java:81)
      at org.apache.cxf.common.injection.ResourceInjector.inject(ResourceInjector.java:76)
      at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:165)
      at org.apache.cxf.bus.extension.ExtensionManagerImpl.activateViaNS(ExtensionManagerImpl.java:86)
      at org.apache.cxf.bus.extension.ExtensionManagerImpl.activateAll(ExtensionManagerImpl.java:94)
      at org.apache.cxf.bus.extension.DeferredMap.undefer(DeferredMap.java:36)
      at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:127)
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:155)
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:97)

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              njiang Willem Jiang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: