1 Reply Latest reply on Oct 12, 2006 3:39 AM by Stefano Maestri

    Webservice and transaction annotations

    Tim Dyck Newbie

      I am currently developing a webservice endpoint using the JbossWS annotations and transaction annotations and I am encountering a problem that I need some help on.

      It seems that when I add in the annotations for transactions then I get the following stack trace message when running in JBoss AS 4.0.4.GA:

      java.lang.RuntimeException: Unable to find method public org.jboss.aop.InstanceAdvisor com.discorp.licensing.server.LicenseServer._getInstanceAdvisor() descriptor=()Lorg/jboss/aop/InstanceAdvisor;
       at org.jboss.lang.AnnotationHelper.getCtMethod(AnnotationHelper.java:214)
       at org.jboss.lang.AnnotationHelper.getAnnotations(AnnotationHelper.java:164)
       at org.jboss.lang.AnnotationHelper.getAnnotation(AnnotationHelper.java:145)
       at org.jboss.lang.AnnotationHelper.isAnnotationPresent(AnnotationHelper.java:130)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:152)
       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 $Proxy31.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.GeneratedMethodAccessor55.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: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.GeneratedMethodAccessor2.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.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.GeneratedMethodAccessor9.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.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: javassist.NotFoundException: _getInstanceAdvisor(..) is not found in com.discorp.licensing.server.LicenseServer
       at javassist.CtClassType.getMethod(CtClassType.java:890)
       at org.jboss.lang.AnnotationHelper.getCtMethod(AnnotationHelper.java:210)
       ... 83 more
      


      Here is my class file code (a shorten version of it):
      imports here...
      
      @WebService(name = "LicenseServer",
       targetNamespace = "urn:LicenseServer")
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
       use = SOAPBinding.Use.LITERAL)
      public class LicenseServer
      {
       private static final Logger _logger = Logger.getLogger(LicenseServer.class);
      
       public LicenseServer() {}
      
       /**
       * Takes in a ClientIdRequest object and generates a ClientId.
       *
       */
       @WebMethod(operationName = "GetClientId")
       @WebResult(name = "ProcessClientId")
       @Tx(TxType.REQUIRED)
       public ProcessClientId getClientID(
       @WebParam(name="ClientIdRequest") ClientIdRequest clientIdRequest)
       throws LicenseServerException
       {
       _logger.info(clientIdRequest);
      
       ClientDO clientDO = LicenseServerDAO.getInstance().getClientDO(clientIdRequest);
      
       //more code...
       }
      
       /**
       * Gets leases for the software ids specified by the client.
       *
       */
       @WebMethod(operationName = "ProcessLeaseRequest")
       @WebResult(name = "LeaseResponse")
       @Tx(TxType.REQUIRED)
       public Lease[] processLeaseRequest(
       @WebParam(name="ClientId") String clientId,
       @WebParam(name="AssetIds") String[] assetIds,
       @WebParam(name="AdditionInfo") Map additionalInfo)
       throws LicenseServerException
       {
       _logger.info("processLeaseRequest");
      
       //more code...
       }
      }
      


      If I remove the transaction stuff and put them on another class then it seems to work fine, though I really need to have the transaction stuff on these methods since they are the entry points. Any ideas as to why it is not working or am I doing something wrong?

      I am using jboss-aop-jdk50.deployer for the aop stuff. Let me know if I need to provide more information then what I have.

      Thanks,

      Tim.