5 Replies Latest reply on Mar 13, 2013 4:14 AM by Bond Chan

    java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.Statel

    Ram Ruk Newbie

      Hi

      I have tried multiple ejb examples and I run into the same exception. The server is unable to invoke setWebServiceContext in the process chain. Please find attached my example. I am using all the libraries from client, server\lib, server\default\lib and server\lib\endorsed.

      Thanks

      >----------------------------------------------------------------------
      package webservice;

      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      import javax.jws.WebMethod;
      import javax.jws.WebService;

      @Stateless
      @WebService(endpointInterface = "webservice.HelloRemote")
      @Remote(HelloRemote.class)
      public class HelloBean {

      @WebMethod
      public String echo(String e) {
      return "Web Service Echo + " + e;
      }
      }

      >----------------------------------------------------------------------
      package webservice;

      import java.rmi.Remote;

      import javax.jws.WebMethod;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import javax.jws.soap.SOAPBinding.Style;

      @WebService
      @SOAPBinding(style = Style.RPC)
      public interface HelloRemote extends Remote {

      @WebMethod
      public String echo(String e);
      }

      >----------------------------------------------------------------------

      package client;

      import java.net.URL;

      import javax.xml.namespace.QName;
      import javax.xml.rpc.Service;
      import javax.xml.rpc.ServiceFactory;

      import webservice.HelloRemote;

      public class HelloBeanClient {
      public static void main(String[] args) throws Exception {
      System.out.println("Starting Test Client");
      URL wsdlUrl = new URL("http://127.0.0.1:8000/" +
      "HelloBeanEAR-HelloBean/HelloBean?wsdl");
      QName qname = new QName("http://hello/", "HelloBeanService");

      System.out.println("Creating a service Using: \n\t"
      + wsdlUrl + " \n\tand " + qname);
      ServiceFactory factory = ServiceFactory.newInstance();


      URL url = new URL("http://127.0.0.1:8000/" +
      "HelloBeanEAR-HelloBean/HelloBean");
      Service remote = factory.createService(wsdlUrl, qname);

      System.out.println("Obtaining reference to a proxy object");

      HelloRemote proxy = (HelloRemote) remote.getPort(HelloRemote.class);
      System.out.println("Accessed local proxy: " + proxy);

      String string = "John";
      System.out.println("Sending: " + string);

      System.out.println("Receiving: " + proxy.echo("John"));
      }
      }

        • 1. Re: java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.St
          Ram Ruk Newbie

          Here is the stack trace associated with the exception.

          15:54:18,190 ERROR [ContainerBase] Servlet.service() for servlet HelloBean threw
          exception
          java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.StatelessBeanContext.setWe
          bServiceContext(Ljavax/xml/ws/WebServiceContext;)V
          at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3$CallbackImpl.at
          tached(InvocationHandlerEJB3.java:134)
          at org.jboss.ejb3.EJBContainerInvocation.setBeanContext(EJBContainerInvo
          cation.java:77)
          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
          sInstanceInterceptor.java:56)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
          at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
          ationInterceptor.java:77)
          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
          enticationInterceptor.java:106)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
          ptor.java:46)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
          at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
          usInterceptor.java:106)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
          at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(Invocati
          onHandlerEJB3.java:103)
          at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpoin
          tInvoker.java:219)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
          dlerImpl.java:476)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
          lerImpl.java:295)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
          .java:205)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
          HandlerImpl.java:131)
          at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
          :81)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
          lter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
          alve.java:230)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
          alve.java:175)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
          yAssociationValve.java:179)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
          e.java:84)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
          ava:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
          ava:104)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
          onnectionValve.java:157)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
          ve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
          a:241)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
          :844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
          ss(Http11Protocol.java:580)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
          7)
          at java.lang.Thread.run(Thread.java:595)

          • 2. Re: java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.St
            Ram Ruk Newbie

            It appears that there could be two different web service stacks deployed on the server and that it is trying to point to the incorrect one. Any clues?

            • 3. Re: java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.St
              Alessio Soldano Master

              Which version of jbossws and jboss application server are you using? Did you try with a fresh installation of both?

              • 4. Re: java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.St
                Ram Ruk Newbie

                This problem is fixed. The issue was that I was trying to install the WS Native 3.0.3 stack on Jboss 4.3 GA. I would recommend anyone using any stack to first run the tests using the "ant tests" before doing anything with it. It should ideally be required to verify successful installation.

                • 5. Re: java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.St
                  Bond Chan Novice

                  this post helps me a lot.. we have the same exact error,

                   

                  but our cause is we have 2 jars in the ${jboss_home}/server/default/lib

                     -jbossws-jboss423.jar

                     -jbossws-jboss42.jar

                   

                  Our community version is 4.2.3 and EAP version is 4.3, delete the jbossws-jboss423.jar works under EAP version, we bring this issue when migrate to EAP.

                   

                  Interest thing is we also found when this 2 jars present in Solaris OS works, but Linux not,  which should be due to the file sorting order is different by the 2 OS.

                  the command 'ls -l' output

                  On solaris :

                          -jbossws-jboss42.jar     

                         -jbossws-jboss423.jar


                  On Linux

                          -jbossws-jboss423.jar

                          -jbossws-jboss42.jar