6 Replies Latest reply on Dec 30, 2006 10:14 AM by Frank Zartmann

    HandlerChain

    Christian Betz Newbie

      Hi again!

      using a @HandlerChain-annotation [@HandlerChain(file="handler-chains.xml",name="")], JBoss 4.0.4 with jbossws1.0.1 throws a "MalformedURLException: no protocol: handler-chains.xml".

      Any ideas? Using absolut URLs is not an option.

      Thanks

      C. Betz

        • 1. Re: HandlerChain
          Antti Luoma Newbie

          How about:

          @HandlerChain(file="file://handler-chains.xml",name="")


          or

          @HandlerChain(file="file://META-INF/handler-chains.xml",name="")


          if you want them to in META-INF folder (in your package)?


          • 2. Re: HandlerChain
            Christian Betz Newbie

            I tried these before, but the result in a

            FileNotFoundException
            .

            • 3. Re: HandlerChain - found the bug in
              Christian Betz Newbie

              I found the bug in /trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java

              Using private void processHandlerChain(Class wsClass, ServerEndpointMetaData epMetaData)

              is not the correct way to handle relative file names.

              Original

              URL fileURL = new URL(handlerChainFile);
              InputStream is = fileURL.openStream();


              Using
              jar:file:///D:/Programme/jboss-4.0.4.GA/server/default/deploy/Accounting.war!/WEB-INF/classes/handler-chains.xml

              for the annotation is a workaround to the problem, but no solution.

              Cheers

              Chris




              • 5. Re: HandlerChain
                Frank Zartmann Newbie

                Hello,

                I've tried the workaround:

                @HandlerChain(file="jar:file:///opt/jboss-4.0.5.GA/server/default/deploy/jsr181pojo.war!/WEB-INF/Handler.xml",name="")
                

                and I get a FileNotFoundException:
                org.jboss.ws.WSException: Cannot process handler chain: jar:file:///opt/jboss-4.0.5.GA/server/default/deploy/jsr181pojo.war!/WEB-INF/Handler.xml
                 at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:560)
                 at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:164)
                 at org.jboss.ws.metadata.AnnotationsMetaDataBuilderJSE.buildMetaData(AnnotationsMetaDataBuilderJSE.java:82)
                 at org.jboss.ws.server.WebServiceDeployerJSE.createWebServicesMetaData(WebServiceDeployerJSE.java:196)
                 at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
                 at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJSE.java:66)
                 at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
                 at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                 at $Proxy45.create(Unknown Source)
                 at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                 at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                 at $Proxy8.deploy(Unknown Source)
                 at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                 at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
                 at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                 at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                 at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                Caused by: java.io.FileNotFoundException: JAR entry WEB-INF/Handler.xml not found in /opt/jboss-4.0.5.GA/server/default/deploy/jsr181pojo.war
                 at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:114)


                And the file Handler.xml resides in the directory WEB-INF:
                > jar tvf jsr181pojo.war
                 ...
                365 Sat Dec 30 11:43:54 CET 2006 WEB-INF/Handler.xml
                726 Sat Dec 30 12:33:06 CET 2006 WEB-INF/web.xml
                

                Did I get it wrong? I'm using jbossws-1.0.3 and jboss-4.0.5.GA .

                Many thanks in advance!

                • 6. Re: HandlerChain
                  Frank Zartmann Newbie

                  Please ignore my last posting, the application server now reads the handler configuration file. But I get a NullPointer Exception:

                  Could not create deployment: file:/opt/jboss-4.0.5.GA/server/default/deploy/jsr181pojo.war
                  java.lang.NullPointerException
                   at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:545)
                  

                  In the class AnnotationsMetaDataBuilder in the method processHandlerChain the Exception is raised because hcName is null:
                  ...
                  for (HandlerChainMetaData handlerChainMetaData : handlerConfigMetaData.getHandlerChains())
                  {
                   String hcName = handlerChainMetaData.getHandlerChainName();
                   if (hcName.equals(anHandlerChain.name()) || anHandlerChain.name() == null)
                   {
                   ....
                  

                  Does anybody knows how to set a value for handlerChainName? This is an attribute of the object HandlerChainMetaData.

                  Many Thanks