Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2, 3.0.0
    • Component/s: webservices
    • Security Level: public (Regular issues)
    • Labels:
    • Patch Info:
      Patch Available

      Description

      Got NPE when using the @HandlerChain annotation in WebService

      1. patch.txt
        0.9 kB
        vu.nguyen

        Activity

        Hide
        vu.nguyen added a comment - - edited

        [Patch] Fix NPE w/ @HandlerChain

        javax.xml.ws.WebServiceException: Error configuring handlers
        	at org.apache.geronimo.cxf.pojo.POJOEndpoint.init(POJOEndpoint.java:96)
        	at org.apache.geronimo.cxf.CXFEndpoint.doPublish(CXFEndpoint.java:190)
        	at org.apache.geronimo.cxf.CXFEndpoint.publish(CXFEndpoint.java:163)
        	at org.apache.geronimo.cxf.pojo.POJOWebServiceContainer.publishEndpoint(POJOWebServiceContainer.java:38)
        	at org.apache.geronimo.cxf.CXFWebServiceContainer.<init>(CXFWebServiceContainer.java:76)
        	at org.apache.geronimo.cxf.pojo.POJOWebServiceContainer.<init>(POJOWebServiceContainer.java:30)
        	at org.apache.geronimo.cxf.pojo.POJOWebServiceContainerFactoryGBean.getWebServiceContainer(POJOWebServiceContainerFactoryGBean.java:113)
        	at org.apache.geronimo.tomcat.TomcatWebAppContext.createWebServices(TomcatWebAppContext.java:286)
        	at org.apache.geronimo.tomcat.TomcatWebAppContext.<init>(TomcatWebAppContext.java:260)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        	at org.apache.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:952)
        	at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
        	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
        	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
        	at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:911)
        	at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:269)
        	at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)
        	at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:525)
        	at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110)
        	at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145)
        	at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119)
        	at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175)
        	at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
        	at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253)
        	at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295)
        	at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)
        	at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:125)
        	at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:539)
        	at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:377)
        	at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
        	at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:190)
        	at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:546)
        	at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:527)
        	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:597)
        	at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
        	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:816)
        	at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
        	at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
        	at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
        	at org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$$4465dd5c.startConfiguration(<generated>)
        	at org.apache.geronimo.console.configmanager.ConfigManagerPortlet.processAction(ConfigManagerPortlet.java:157)
        	at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)
        	at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
        	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
        	at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
        	at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85)
        	at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217)
        	at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:121)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.geronimo.console.filter.RedirectByHashFilter.doFilter(RedirectByHashFilter.java:116)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.geronimo.console.filter.PlutoURLRebuildFilter.doFilter(PlutoURLRebuildFilter.java:48)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.geronimo.console.filter.XSSXSRFFilter.doFilter(XSSXSRFFilter.java:130)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        	at org.apache.geronimo.tomcat.security.SecurityValve.invoke(SecurityValve.java:131)
        	at org.apache.geronimo.tomcat.security.jacc.JACCSecurityValve.invoke(JACCSecurityValve.java:54)
        	at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:420)
        	at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
        	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
        	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2087)
        	at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214)
        	at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        	at java.lang.Thread.run(Thread.java:662)
        Caused by: javax.xml.ws.WebServiceException: Chain not specified
        	at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:76)
        	at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:88)
        	at org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver.getHandlerChain(GeronimoHandlerResolver.java:63)
        	at org.apache.geronimo.cxf.CXFEndpoint.initHandlers(CXFEndpoint.java:285)
        	at org.apache.geronimo.cxf.pojo.POJOEndpoint.init(POJOEndpoint.java:93)
        	... 92 more
        Caused by: java.lang.NullPointerException
        	at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:265)
        	at org.apache.geronimo.xbeans.javaee.HandlerChainsDocument$Factory.parse(Unknown Source)
        	at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:64)
        	... 96 more
        
        Show
        vu.nguyen added a comment - - edited [Patch] Fix NPE w/ @HandlerChain javax.xml.ws.WebServiceException: Error configuring handlers at org.apache.geronimo.cxf.pojo.POJOEndpoint.init(POJOEndpoint.java:96) at org.apache.geronimo.cxf.CXFEndpoint.doPublish(CXFEndpoint.java:190) at org.apache.geronimo.cxf.CXFEndpoint.publish(CXFEndpoint.java:163) at org.apache.geronimo.cxf.pojo.POJOWebServiceContainer.publishEndpoint(POJOWebServiceContainer.java:38) at org.apache.geronimo.cxf.CXFWebServiceContainer.<init>(CXFWebServiceContainer.java:76) at org.apache.geronimo.cxf.pojo.POJOWebServiceContainer.<init>(POJOWebServiceContainer.java:30) at org.apache.geronimo.cxf.pojo.POJOWebServiceContainerFactoryGBean.getWebServiceContainer(POJOWebServiceContainerFactoryGBean.java:113) at org.apache.geronimo.tomcat.TomcatWebAppContext.createWebServices(TomcatWebAppContext.java:286) at org.apache.geronimo.tomcat.TomcatWebAppContext.<init>(TomcatWebAppContext.java:260) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:952) at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276) at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96) at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61) at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:911) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:269) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103) at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:525) at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110) at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145) at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119) at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175) at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44) at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:125) at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:539) at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:377) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456) at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:190) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:546) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:527) 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:597) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:816) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) at org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$$4465dd5c.startConfiguration(<generated>) at org.apache.geronimo.console.configmanager.ConfigManagerPortlet.processAction(ConfigManagerPortlet.java:157) at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218) at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488) at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167) at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85) at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217) at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:121) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.geronimo.console.filter.RedirectByHashFilter.doFilter(RedirectByHashFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.geronimo.console.filter.PlutoURLRebuildFilter.doFilter(PlutoURLRebuildFilter.java:48) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.geronimo.console.filter.XSSXSRFFilter.doFilter(XSSXSRFFilter.java:130) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.geronimo.tomcat.security.SecurityValve.invoke(SecurityValve.java:131) at org.apache.geronimo.tomcat.security.jacc.JACCSecurityValve.invoke(JACCSecurityValve.java:54) at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:420) at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2087) at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214) at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang. Thread .run( Thread .java:662) Caused by: javax.xml.ws.WebServiceException: Chain not specified at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:76) at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:88) at org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver.getHandlerChain(GeronimoHandlerResolver.java:63) at org.apache.geronimo.cxf.CXFEndpoint.initHandlers(CXFEndpoint.java:285) at org.apache.geronimo.cxf.pojo.POJOEndpoint.init(POJOEndpoint.java:93) ... 92 more Caused by: java.lang.NullPointerException at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:265) at org.apache.geronimo.xbeans.javaee.HandlerChainsDocument$Factory.parse(Unknown Source) at org.apache.geronimo.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:64) ... 96 more
        Hide
        Ivan added a comment -

        Hi, the initial codes is correct, IMO. There is a little difference between the class.getResource and classloader.getResource. You might check them in the java doc. For the file attribute description in HandlerChain, it is of the same behavior of class.getResource method.
        --->

        file
        public abstract java.lang.String file
        Location of the handler chain file.
        The location supports 2 formats:

        An absolute java.net.URL in externalForm (ex: http://myhandlers.foo.com/handlerfile1.xml).
        A relative path from the source file or class file (ex: bar/handlerfile1.xml).

        <---

        Show
        Ivan added a comment - Hi, the initial codes is correct, IMO. There is a little difference between the class.getResource and classloader.getResource. You might check them in the java doc. For the file attribute description in HandlerChain, it is of the same behavior of class.getResource method. ---> file public abstract java.lang.String file Location of the handler chain file. The location supports 2 formats: An absolute java.net.URL in externalForm (ex: http://myhandlers.foo.com/handlerfile1.xml ). A relative path from the source file or class file (ex: bar/handlerfile1.xml). <---
        Hide
        vu.nguyen added a comment -

        Hi Ivan,

        I got the NPE error in both cases:

        + absolute path: @HandlerChain(file="file:///path/to/handlers.xml")
        + relative path: @HandlerChain(file="handlers.xml")

        My environment:
        + Slackware Linux
        + jdk 1.6.0
        + Geronimo 2.2.1 w/ Tomcat + CXF 2.1.10

        Show
        vu.nguyen added a comment - Hi Ivan, I got the NPE error in both cases: + absolute path: @HandlerChain(file="file:///path/to/handlers.xml") + relative path: @HandlerChain(file="handlers.xml") My environment: + Slackware Linux + jdk 1.6.0 + Geronimo 2.2.1 w/ Tomcat + CXF 2.1.10
        Hide
        Ivan added a comment -

        what is the structure of the handlers.xml and the class annotated with HandlerChain ?

        Show
        Ivan added a comment - what is the structure of the handlers.xml and the class annotated with HandlerChain ?
        Hide
        vu.nguyen added a comment - - edited

        Ivan,

        The problem doesn't relate to the structure of the handlers.xml file, but is the system cannot find the location of the handlers.xml file. That cause the NPE error and I fixed by my patch

        FYI,
        + handlers.xml

        <handler-chains xmlns="http://java.sun.com/xml/ns/javaee" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
            <handler-chain>
                <handler>
                    <handler-name>JAXWSHandler</handler-name>
                    <handler-class>examples.JAXWSHandler</handler-class>
                </handler>
            </handler-chain>
        </handler-chains>                
        

        + JAXWSHandler.java

        public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
        
            public boolean handleMessage(SOAPMessageContext context) {
                System.out.println("handleMessage()......");
                return true;
            }
        
            public boolean handleFault(SOAPMessageContext context) {
                System.out.println("handleFault()......");
                return true;
            }
        
            public void close(MessageContext context) {
                System.out.println("close()......");
            }
        
            public Set<QName> getHeaders() {
                System.out.println("getHeaders()......");
                return null;
            }
         }
        

        + ServerInfo.java

        @WebService
        @HandlerChain(file="handlers.xml")
        public class ServerInfo{
            @WebMethod
            public String getServerName() {
                return "abc";
            }
        }
        
        Show
        vu.nguyen added a comment - - edited Ivan, The problem doesn't relate to the structure of the handlers.xml file, but is the system cannot find the location of the handlers.xml file. That cause the NPE error and I fixed by my patch FYI, + handlers.xml <handler-chains xmlns= "http://java.sun.com/xml/ns/javaee" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://java.sun.com/xml/ns/javaee" > <handler-chain> <handler> <handler-name> JAXWSHandler </handler-name> <handler-class> examples.JAXWSHandler </handler-class> </handler> </handler-chain> </handler-chains> + JAXWSHandler.java public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> { public boolean handleMessage(SOAPMessageContext context) { System .out.println( "handleMessage()......" ); return true ; } public boolean handleFault(SOAPMessageContext context) { System .out.println( "handleFault()......" ); return true ; } public void close(MessageContext context) { System .out.println( "close()......" ); } public Set<QName> getHeaders() { System .out.println( "getHeaders()......" ); return null ; } } + ServerInfo.java @WebService @HandlerChain(file= "handlers.xml" ) public class ServerInfo{ @WebMethod public String getServerName() { return "abc" ; } }
        Hide
        Ivan added a comment - - edited

        I did not mean the content of the handlers.xml and ServerInfo class.
        The handlers.xml and ServerInfo.class should be in the same folder. Could you double check it ?

        Show
        Ivan added a comment - - edited I did not mean the content of the handlers.xml and ServerInfo class. The handlers.xml and ServerInfo.class should be in the same folder. Could you double check it ?
        Hide
        vu.nguyen added a comment -

        The structure:

        WEB-INF/
           + classes/
                + examples/
                     + JAXWSHandler.class
                     + ServerInfo.class
                + handlers.xml
        
        Show
        vu.nguyen added a comment - The structure: WEB-INF/ + classes/ + examples/ + JAXWSHandler.class + ServerInfo.class + handlers.xml
        Hide
        Ivan added a comment -

        I think that handlers.xml file should be also in the examples folder according to the description of file attribute.
        --->

        Show
        Ivan added a comment - I think that handlers.xml file should be also in the examples folder according to the description of file attribute. --->
        Hide
        vu.nguyen added a comment -

        Ivan,
        Why? and how about the absolute path case?

        Show
        vu.nguyen added a comment - Ivan, Why? and how about the absolute path case?
        Hide
        Ivan added a comment -

        In my first comment, I pasted the doc for HandlerChain, if you would like to use absolute path, it should be something like /handler.xml or file://...
        If no other issue, I will close this jira.

        Show
        Ivan added a comment - In my first comment, I pasted the doc for HandlerChain, if you would like to use absolute path, it should be something like /handler.xml or file:// ... If no other issue, I will close this jira.
        Hide
        vu.nguyen added a comment - - edited

        Ivan,

        As I showed, I failed in both of cases:

        + absolute path: @HandlerChain(file="file:///path/to/handlers.xml")
        + relative path: @HandlerChain(file="handlers.xml")
        
        Show
        vu.nguyen added a comment - - edited Ivan, As I showed, I failed in both of cases: + absolute path: @HandlerChain(file= "file: ///path/to/handlers.xml" ) + relative path: @HandlerChain(file= "handlers.xml" )
        Hide
        Ivan added a comment -

        + absolute path: @HandlerChain(file="file:///path/to/handlers.xml")
        I checked the codes, there might be issue with this, I will double check it later.

        + relative path: @HandlerChain(file="handlers.xml")
        With this format, it looks to me that it means handlers.xml and ServerInfo.class should be both in the example folder. From the structure in your last comment, they are not. Right ?

        Show
        Ivan added a comment - + absolute path: @HandlerChain(file="file:///path/to/handlers.xml") I checked the codes, there might be issue with this, I will double check it later. + relative path: @HandlerChain(file="handlers.xml") With this format, it looks to me that it means handlers.xml and ServerInfo.class should be both in the example folder. From the structure in your last comment, they are not. Right ?
        Hide
        vu.nguyen added a comment - - edited

        <----
        + relative path: @HandlerChain(file="handlers.xml")
        With this format, it looks to me that it means handlers.xml and ServerInfo.class should be both in the example folder. From the structure in your last comment, they are not. Right ?


        yes, it is

        Show
        vu.nguyen added a comment - - edited <---- + relative path: @HandlerChain(file="handlers.xml") With this format, it looks to me that it means handlers.xml and ServerInfo.class should be both in the example folder. From the structure in your last comment, they are not. Right ? yes, it is
        Hide
        Ivan added a comment -

        Commit changes to 2.2.1 branch at rev1170411, and trunk r1170413.

        Show
        Ivan added a comment - Commit changes to 2.2.1 branch at rev1170411, and trunk r1170413.
        Hide
        Ivan added a comment -

        Commit changes to support absolute URL form in the HandlerChain annotation.

        Show
        Ivan added a comment - Commit changes to support absolute URL form in the HandlerChain annotation.

          People

          • Assignee:
            Ivan
            Reporter:
            vu.nguyen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development