0 Replies Latest reply on Sep 4, 2006 2:21 PM by Arno Werr

    Patient is more dead then alive? jax-rpc Handler that is.

    Arno Werr Newbie

      Hi gents,

      Here we go. EJB3 with web service annotations

      @WebService(name = "Test", serviceName = "TestService")
      @WebServiceRef(name = "service/TestService")
      @HandlerChain(file = "http://localhost/servers/jboss/handlers.xml", name = "")
      @Stateless
      public class TestWebService implements TestSEI {
       private Logger logger;
      
       @PostConstruct
       public void postConstruct() {
       logger = Logger.getLogger(getClass());
       }
      
       @WebMethod
       @Oneway
       public void test(@WebParam(name = "TEST")
       String input) {
       logger.debug("test() called with input: " + input);
      
       }
      }
      

      Simple, hah? Note
      @HandlerChain(file = "http://localhost/servers/jboss/handlers.xml", name = "")
      Any other protocol - flat dead - FileNotFoundException. The same issue see: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85018

      Handler
      public class LoggingHandler extends GenericHandler {
       private Logger logger = Logger.getLogger(getClass());
      
       public QName[] getHeaders() {
       return null;
       }
      
       public boolean handleRequest(MessageContext context) {
       logger.debug("handleRequest() " + context);
       SOAPMessageContext smc = (SOAPMessageContext) context;
       SOAPMessage msg = smc.getMessage();
      
       try {
       SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
       SOAPHeader header = envelope.getHeader();
      
       logger.debug("We are here ");
      
       } catch (SOAPException e) {
       throw new JAXRPCException(e);
       }
       return true;
       }
      }
      

      No brainer.
      Now - handlers.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <jws:handler-config xmlns:jws="http://java.sun.com/xml/ns/javaee">
       <jws:handler-chains>
       <jws:handler-chain>
       <jws:handler>
       <jws:handler-class>
       <![CDATA[org.jboss.tutorial.ee.service.impl.ws.handler.LoggingHandler]]>
       </jws:handler-class>
       </jws:handler>
       </jws:handler-chain>
       </jws:handler-chains>
      </jws:handler-config>
      

      It's there. I made sure I can get it from my browser http://localhost/servers/jboss/handlers.xml.
      Now, trying to deploy on JBoss
      13:40:26,736 INFO [Server] Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
      
      Specification-Title: JBossWS
      Specification-Version: jbossws-1.0
      Specification-Vendor: JBoss (http://www.jboss.org)
      Implementation-Title: JBoss Web Services (JBossWS)
      Implementation-URL: http://www.jboss.org/products/jbossws
      Implementation-Version: jbossws-1.0.0.GA (date=200604281743)
      Implementation-Vendor: JBoss Inc.
      Implementation-Vendor-Id: http://www.jboss.org
      

      Fire it up. Boom!!!
      2006-09-04 13:41:34,256 WARN [org.jboss.ws.metadata.EndpointMetaData] Cannot obtain style, using default: document
      2006-09-04 13:41:34,258 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] Generating wrapper: org.jboss.tutorial.ee.service.impl.ws.__JBossWS_TestService_TestPort_test
      2006-09-04 13:41:34,851 ERROR [org.jboss.deployment.MainDeployer] Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar
      java.lang.NullPointerException
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:545)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:164)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilderEJB3.buildMetaData(AnnotationsMetaDataBuilderEJB3.java:93)
       at org.jboss.ws.server.WebServiceDeployerEJB3.createWebServicesMetaData(WebServiceDeployerEJB3.java:91)
       at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
       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 $Proxy36.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor14.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 $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       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 $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       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.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 $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:595)
      2006-09-04 13:41:34,890 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2006-09-04 13:41:34,890 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2006-09-04 13:41:34,894 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2006-09-04 13:41:34,896 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@f8f8ff32{ url=file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear, deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar; - nested throwable: (java.lang.NullPointerException)
       at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:975)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor14.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 $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       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 $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       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.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 $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.NullPointerException
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:545)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:164)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilderEJB3.buildMetaData(AnnotationsMetaDataBuilderEJB3.java:93)
       at org.jboss.ws.server.WebServiceDeployerEJB3.createWebServicesMetaData(WebServiceDeployerEJB3.java:91)
       at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
       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 $Proxy36.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
       ... 69 more
      2006-09-04 13:41:34,898 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear -> file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear
      2006-09-04 13:41:34,900 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
      
      --- Incompletely deployed packages ---
      org.jboss.deployment.DeploymentInfo@f8f8ff32 { url=file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear }
       deployer: org.jboss.deployment.EARDeployer@192425a
       status: Deployment FAILED reason: Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar; - nested throwable: (java.lang.NullPointerException)
       state: FAILED
       watch: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear
       altDD: null
       lastDeployed: 1157391683378
       lastModified: 1157391682000
       mbeans:
      
      
      2006-09-04 13:41:34,987 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Notified that enabled: true
      2006-09-04 13:41:34,987 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Started jboss.deployment:type=DeploymentScanner,flavor=URL
      2006-09-04 13:41:34,987 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
      2006-09-04 13:41:34,988 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
      

      Commented out reference to a handler chain. Everything works just fine. So, we do not have handlers on JBoss 4.0.4, right? Or where do I goof up?
      Any ideas?

      Cheers,
      Arno