3 Replies Latest reply on Nov 22, 2007 6:30 AM by dkane

    JAX-WS from Sessions Bean fails due to missing org/jboss/log

    ejb3workshop

      I have a standalone client jar which using JAX-WS in JDK1.6 is able to consume a webservice. I would like to invoke the webservice from a session bean, so I added the webservice client JAR to my ear file and updated the application.xml file.

      The problem is that when I try to invoce the client from within JBoss I get the following error.

      A search in the forums and the web makes suggestions to include the jboss-common-clients.jar in the classpath. I tried added this jar to the /server/default/lib folder as well as include it within the EAR / application.xml, of which neiter worked.

      If JAX-WS client is not supported what other libraries can I use to consume a web service from a Session Bean.


      java.lang.NoClassDefFoundError: org/jboss/logging/Logger
      at javax.xml.soap.FactoryLoader.<clinit>(FactoryLoader.java:47)
      at javax.xml.soap.SOAPFactory.newInstance(SOAPFactory.java:64)
      at org.jboss.ws.core.soap.SOAPFactoryImpl.createElement(SOAPFactoryImpl.java:120)
      at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:116)
      at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:85)
      at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:254)
      at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:75)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:472)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:304)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:135)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
      at org.jboss.remoting.Client.invoke(Client.java:1550)
      at org.jboss.remoting.Client.invoke(Client.java:530)
      at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:171)
      at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
      at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:322)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)


        • 1. Re: JAX-WS from Sessions Bean fails due to missing org/jboss

          I had similar classpath problems, when I added the JBoss JAX-WS jars to the server. I guess that has something to do with mixing the JDK6 JAX-WS implementation with the JBoss JAX-WS implementation.

          But if you want to invoke a web service from a stateless session bean you don't need to do that.
          If you are using JBoss 4.2 and EJB3 you can do it like that:

          1. Use the wsconsume tool (in JBoss/bin directory) to generate your web service class files from your wsdl file.
          2. Add these files to your classpath.
          3. Write a stateless session bean like that:

          @Stateless
          public class WSInvoker
          {
           // Replace MyWebService with your generated web service class name here
           @WebServiceRef
           private static MyWebService service;
          
           public void invokeWS()
           {
           MyEndpoint entpoint = service.getEndpoint(MyEndpoint.class);
           // invoke the endpoint's buisness methods
           }
          }


          I hope I could help you.


          • 2. Re: JAX-WS from Sessions Bean fails due to missing org/jboss
            thomas.diesler
            • 3. Re: JAX-WS from Sessions Bean fails due to missing org/jboss
              dkane

               

              "ejb3workshop" wrote:

              A search in the forums and the web makes suggestions to include the jboss-common-clients.jar in the classpath. I tried added this jar to the /server/default/lib folder as well as include it within the EAR / application.xml, of which neiter worked.


              "ejb3workshop" wrote:
              java.lang.NoClassDefFoundError: org/jboss/logging/Logger
              at javax.xml.soap.FactoryLoader.<clinit>(FactoryLoader.java:47)
              at javax.xml.soap.SOAPFactory.newInstance(SOAPFactory.java:64)


              I have the same problem, although web-service is being invoked remotely.
              Adding jboss-common-client.jar or jbossall-client.jar to JBoss classpath does not help.
              Then I tried to put this jar to lib/endorsed, next to jars required for JBossWS on Java 1.6 , and JBoss failed to start at all.
              Somehow, endorsed classes does not "see" JBoss classpath ... How to solve this problem ?