Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9851

secure-soap quickstart throws NPE in 7.3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.3
    • fuse-7.3
    • None
    • None
    • % %
    • Fuse 7.3 Sprint 38

      I'm trying to run https://github.com/jboss-fuse/karaf-quickstarts/tree/master/cxf/secure-soap quickstart and I have one problem.
      All generally builds and starts well, but when I run org.jboss.fuse.quickstarts.cxf.soap.secure.SecureSoapTest I'm getting NPE:

      java.lang.NullPointerException: null
      	at com.sun.xml.bind.v2.runtime.MarshallerImpl.setProperty(MarshallerImpl.java:501) ~[?:?]
      	at org.apache.cxf.common.jaxb.JAXBUtils.setEscapeHandler(JAXBUtils.java:1567) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.jaxb.io.DataWriterImpl.lambda$createMarshaller$0(DataWriterImpl.java:138) ~[88:org.apache.cxf.cxf-rt-databinding-jaxb:3.2.7.fuse-730001]
      	at org.apache.cxf.jaxb.JAXBDataBinding.applyEscapeHandler(JAXBDataBinding.java:271) ~[88:org.apache.cxf.cxf-rt-databinding-jaxb:3.2.7.fuse-730001]
      	at org.apache.cxf.jaxb.io.DataWriterImpl.createMarshaller(DataWriterImpl.java:138) ~[88:org.apache.cxf.cxf-rt-databinding-jaxb:3.2.7.fuse-730001]
      	at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:239) ~[88:org.apache.cxf.cxf-rt-databinding-jaxb:3.2.7.fuse-730001]
      	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:118) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) ~[118:org.apache.cxf.cxf-rt-wsdl:3.2.7.fuse-730001]
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.interceptor.security.JAASLoginInterceptor$1.run(JAASLoginInterceptor.java:156) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.interceptor.security.JAASLoginInterceptor$1.run(JAASLoginInterceptor.java:149) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
      	at javax.security.auth.Subject.doAs(Subject.java:360) ~[?:?]
      	at org.apache.cxf.interceptor.security.JAASLoginInterceptor.handleMessage(JAASLoginInterceptor.java:149) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[82:org.apache.cxf.cxf-core:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[45:javax.servlet-api:3.1.0]
      	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) ~[108:org.apache.cxf.cxf-rt-transports-http:3.2.7.fuse-730001]
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64) ~[38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at org.ops4j.pax.web.service.undertow.internal.Context$1.lambda$wrap$0(Context.java:614) ~[?:?]
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [38:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:330) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812) [37:io.undertow.core:1.4.18.SP7-redhat-1]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
      	at java.lang.Thread.run(Thread.java:748) [?:?]
      

      yfang@redhat.com, when checking why org.apache.cxf.jaxb.JAXBDataBinding#escapeHandler is null, I found this exception:

      java.lang.IllegalArgumentException: interface com.sun.xml.bind.marshaller.CharacterEscapeHandler is not visible from class loader
      	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581)
      	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
      	at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
      	at java.lang.reflect.WeakCache.get(WeakCache.java:127)
      	at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
      	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
      	at org.apache.cxf.common.util.ProxyHelper.getProxyInternal(ProxyHelper.java:49)
      	at org.apache.cxf.common.util.ProxyHelper.getProxy(ProxyHelper.java:126)
      	at org.apache.cxf.common.jaxb.JAXBUtils.createEscapeHandler(JAXBUtils.java:1597)
      	at org.apache.cxf.common.jaxb.JAXBUtils.createMininumEscapeHandler(JAXBUtils.java:1575)
      	at org.apache.cxf.jaxb.JAXBDataBinding.setContext(JAXBDataBinding.java:257)
      	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:361)
      	at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
      	at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:470)
      	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:695)
      	at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:530)
      	at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)
      	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
      	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
      	at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
      	at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
      	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
      	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
      	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
      	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:331)
      	at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838)
      	at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:703)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666)
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90)
      	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360)
      	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:716)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:413)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278)
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:299)
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:268)
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:264)
      	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:254)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
      	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)
      	at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730)
      	at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485)
      	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579)
      	at org.apache.felix.framework.Felix.startBundle(Felix.java:2174)
      	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
      	at org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:51)
      	at org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:56)
      	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571)
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497)
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386)
      	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417)
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      That's kind of strange, because the error is thrown in:

      return ProxyHelper.getProxy(cls.getClassLoader(),
                                  new Class[] {handlerInterface},
                                  new EscapeHandlerInvocationHandler(targetHandler));
      

      and:

      • cls is class com.sun.xml.bind.v2.runtime.JAXBContextImpl
      • cls.getClassLoader() is CL of bundle org.apache.servicemix.bundles.jaxb-impl [160]
      • postfix is empty
      • handlerClass is loaded fine as class com.sun.xml.bind.marshaller.MinimumEscapeHandler
      • handlerInterface is loaded fine as interface com.sun.xml.bind.marshaller.CharacterEscapeHandler

      yfang@redhat.com wdyt?

            yfang@redhat.com Freeman(Yue) Fang
            ggrzybek Grzegorz Grzybek
            Jan Kasztura Jan Kasztura (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: