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

NPE is thrown when publish the code first service in NoSpringServlet

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1, 2.0.8
    • 2.1.2, 2.0.9
    • Transports
    • None

    Description

      If we publish a code first service with JAXWS API in NoSpringServlet like this
      HelloImpl helloImpl = new HelloImpl();
      Endpoint.publish("/Hello", helloImpl);

      The stack trace like this
      Caused by: 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:63)
      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:398)
      at org.apache.cxf.common.injection.ResourceInjector.visitMethod(ResourceInjector.java:185)
      at org.apache.cxf.common.annotation.AnnotationProcessor.processMethods(AnnotationProcessor.java:87)
      at org.apache.cxf.common.annotation.AnnotationProcessor.accept(AnnotationProcessor.java:70)
      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:175)
      at org.apache.cxf.bus.extension.ExtensionManagerImpl.activateViaNS(ExtensionManagerImpl.java:96)
      at org.apache.cxf.bus.extension.ExtensionManagerImpl.activateAll(ExtensionManagerImpl.java:104)
      at org.apache.cxf.bus.extension.DeferredMap.undefer(DeferredMap.java:36)
      at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:140)
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:206)
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:146)
      at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:116)
      at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
      at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:336)
      at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
      ... 6 more

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: