1 2 Previous Next 23 Replies Latest reply on Apr 1, 2006 12:37 PM by irisel

    java.lang.NoClassDefFoundError: org/apache/axis/client/Servi

    forjbpm

      Hi all,
      I was trying to connect to my webservice which is statless session ejb type webservice.
      I would like to know which jar file consists of org/apache/axis/client/Service.class?
      I am getting following error:

      13:54:53,344 ERROR [[/FiboWeb]] StandardWrapper.Throwable
      java.lang.NoClassDefFoundError: org/apache/axis/client/Service
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
       at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
       at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at com.jbpm.Webservice.servlet.FiboServlet.init(FiboServlet.java:52)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:81)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      13:54:53,346 ERROR [[Compute]] Allocate exception for servlet Compute
      java.lang.NoClassDefFoundError: org/apache/axis/client/Service
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
       at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
       at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at com.jbpm.Webservice.servlet.FiboServlet.init(FiboServlet.java:52)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:81)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      

      Please Help!


        • 1. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
          pierroot

          I have the exact same problem...

          It would be nice if someone knows a way to get those clients to work...

          • 2. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
            forjbpm

            Hi Pierroot,

            I somehow got rid of this prblem (though my client is not still working now)
            My problem was in Jboss-4.0.3/cient directory there was no jboss-ws4ee.sar/ .
            Make sure that its there I guess this .sar file has the all the required classes

            Hope it helps!
            Please let me know if you can get your client working :-)

            • 3. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
              pierroot

              Hi forJbpm,

              Well I had the jboss-ws4ee/sar installed but it was not working. Finally I managed to get things work by adding the Jar files included in axis in the Jboss lib folder...

              Nevertheless, I had to quit using axis for other reasons on JBoss and I am now trying to use the ws4ee as it should be... But I can't manage to get my client to be bound :((

              I thought web services were easy to use... I don't think it's the case in JBoss...

              • 4. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                forjbpm

                Oh! yeh I am finding it a bit difficult to!
                axis.jar, jboss-ws4ee.sar are the two files required. Both the files are shipped with JBOSS AS.
                I am also struggling a lot with this now. My aim is to develop a webservice which will allow any client( perl client in my case) to connect to use Jboss Jbpm and to have my own webinterface for the same.

                I will keep you posted if I find anything good

                ATB!

                • 5. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                  pierroot

                  Thanks same thing here... I will let you know if I find a good way to use WS with the "recommended" pratice !!

                  (I had issue with axis, that's why I switched)

                  • 6. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                    irisel

                    I have the same problem too. But, with JBoss 4.0.4 axis is not supported anymore, is it?
                    Another issue is, if the best practice now is to use wscompile instead of java2wsdl, why JWSDP jars are not included as part of the IDE? I have had to add manually all the jars to the ant-wscompile-build files and also to the eclipse project. is that usual practice ?

                    • 7. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                      pierroot

                      Axis is no longer supported as you said. The best practice is now to use the wscompile tool but, as far as I understand the thing, you don't have to use all the files generated...

                      So I guess you don't need the files which requires non present libraries. I think this is part of their willing to create fully portable WS.

                      You have to build a client with jndi (this is what I cannot manage to do :( ) in order to use those files, but you shouldn't need to add additional jars in your project, since they may not be present in ws4ee...

                      • 8. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                        irisel

                        Ok, so we are supposed to use wscompile only for the mappings & wsdl, and discard all of the stubs??

                        For the client problem, i wonder if we need to deploy some war, as I have read in one post.
                        Another question is how do you relate the interface passed to wscompile to the bean that serves the ws.
                        I tried to use the same interface (the remote if) but i got "cannot extend EJBHome". So i wrote a new one extending Remote and it deploys, but have the same problem (NoClassDefFound)

                        • 9. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                          prashanttejura

                          SOLUTION:-
                          KEEP 1) jaxrpc.jar, 2) axis.jar, 3)saaj.jar inside your {JBOSS_HOME}/server/default/lib

                          • 10. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                            prashanttejura

                            Eventhough it took me 3 days of trial & error to arrive at the above solution i hope we guys dont need to write-off JBoss that easily ;-)

                            • 11. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                              pierroot

                              This works but JBoss says then no longer support axis (that's why we gotta add those jars to the lib folder (by the way, do not forget to reboot your server so that jars files are used ! ;)) how about using the ws4ee service stack as recommended by JBoss ??

                              I tried the tutorial in the wiki (rpc step by step) but binding the jndi is something :
                              1) I never did before
                              2) I can't make work !!!!

                              • 12. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                                thomas.diesler

                                The above solution is incorrect.

                                Read the FAQs on what jars are needed
                                http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWSFAQ

                                We do not support Apache Axis in any form or flavour. If you decide to use Axis instead of portable J2EE-1.4 compliant web service as provided by jboss-ws4ee.sar or jbossws.sar you must remove all web service related jars that come with the jboss binary distribution.

                                More interesting, what is the specific issue you have with J2EE-1.4 compliant web services? What is not clear about the samples attached to the main wiki?

                                • 13. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                                  pierroot

                                  Hi Thomas,

                                  I did the tutorial rpc step by step (for the client side only). Basicaly, I try to call a web service that returns "hello 'your name'".

                                  The web service is hosted on an apache Axis web server. I am trying to create a servlet which calls this webservice. The problem is that there is no way I can bind my ws4ee client (I change the ws4ee name in my xml files)...

                                  I tried several things and did several tutorials on the same subjects using the same method but I always get this exception.

                                  Is there any particular way to do this ??

                                  Thank you

                                  • 14. Re: java.lang.NoClassDefFoundError: org/apache/axis/client/S
                                    irisel

                                    Hi all,

                                    I get it to work. Now it seems easy.
                                    I am using JBossIDE 1.5.1 GA and JBoss 4.0.4RC1.
                                    For the client, the one that works is the one generated by wscompile (and not the one generated by JBossIDE). Better than words, I attach my config files.

                                    This is my config file for wscompile to generate the client:

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    
                                    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
                                     <!-- <service> or <wsdl> or <modelfile> -->
                                     <wsdl
                                     location="http://localhost:8080/OMBrowserEJB/OMBrowserEndpoint?wsdl"
                                     packageName="com.irisel.oms.ws.client2" />
                                    </configuration>
                                    


                                    And this is my build.xml to run wscompile:

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <project name="WS Artifacts Generator" default="_ws_generation_">
                                     <property file="xdoclet-build.properties" />
                                     <property name="eclipse.home" value="C:/JBossIDE/eclipse" />
                                     <property name="xdoclet.basedir" value="${eclipse.home}/plugins/org.jboss.ide.eclipse.xdoclet.core_1.5.1.GA" />
                                     <property name="jboss.net.version" value="4.0" />
                                    
                                     <path id="project.classpath">
                                     <pathelement location="build" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/ejb-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jacc-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jca-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jms-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jsp-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jta-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/servlet-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/sql-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/jaxr-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/jaxrpc-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/saaj-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/xml-api.jar" />
                                     <pathelement location="C:/IRISEL/eclipse/oms/ext/mysql-connector-java-3.0.8-stable-bin.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-aop.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-common.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/qdox.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/concurrent.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/trove.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/javassist.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-aspect-library.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/bsh-1.3.0.jar" />
                                     <pathelement location="C:/IRISEL/eclipse/oms/build" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/ejb-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jca-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jms-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jsp-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jta-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/servlet-api.jar" />
                                     <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/sql-api.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/activation.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/improvider.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/imservice.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jaxen-core.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jaxrpc-impl.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jso.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jss4.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/log4j.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/mail.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/saxpath.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/xmppd.jar" />
                                     <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/xp.jar" />
                                     <pathelement location="C:/Program Files/Java/JDK1.5.0_04/lib/tools.jar" />
                                     </path>
                                    
                                     <target name="_ws_generation_" depends="target_wscompile" />
                                     <target name="target_wscompile" description="wscompile ">
                                    
                                     <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
                                     <classpath>
                                     <path refid="project.classpath" />
                                     </classpath>
                                     </taskdef>
                                     <wscompile verbose="true" xPrintStackTrace="true" keep="true" fork="true" base="build" server="true" sourcebase="src" mapping="src/META-INF/jaxrpc-mapping.xml" nonclassdir="src/META-INF/wsdl" config="wscompile.config.xml">
                                     <classpath>
                                     <path refid="project.classpath" />
                                     </classpath>
                                     </wscompile>
                                     </target>
                                     <target name="target_wscompile_client" description="wscompile ">
                                    
                                     <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
                                     <classpath>
                                     <path refid="project.classpath" />
                                     </classpath>
                                     </taskdef>
                                     <wscompile gen="true" base="build" features="explicitcontext,wsi,unwrap" keep="true" debug="true" verbose="true" xPrintStackTrace="true" fork="true" sourcebase="src" config="wscompile.client.config.xml">
                                     <classpath>
                                     <path refid="project.classpath" />
                                     </classpath>
                                     </wscompile>
                                     </target>
                                    </project>
                                    


                                    My Webservice interface (it's a copy of the EJB Remote interface, changing the declaration to extend Remote:


                                    package com.irisel.oms.ws;
                                    
                                    import java.rmi.Remote;
                                    
                                    /**
                                     * Remote interface for OMGenEJB.
                                     */
                                    public interface OMBrowserEndpoint
                                     extends Remote
                                    {
                                     /**
                                     * Business method that execs "method" of CLBrowser interface
                                     */
                                     public java.lang.String exec( java.lang.String method,java.lang.String[] args )
                                     throws java.rmi.RemoteException;
                                    
                                     /**
                                     * Business method
                                     */
                                     public java.lang.String echo( java.lang.String s )
                                     throws java.rmi.RemoteException;
                                    
                                    }
                                    


                                    And finally, my Test program:

                                    package com.irisel.oms.ws.client2;
                                    
                                    public class Test {
                                    
                                     /**
                                     * @param args
                                     */
                                     public static void main(String[] args) {
                                     // TODO Auto-generated method stub
                                     try {
                                    
                                     OMBrowserWebService_Impl locator = new OMBrowserWebService_Impl();
                                     com.irisel.oms.ws.client2.OMBrowserEndpoint svc = locator.getOMBrowserEndpointPort();
                                     System.out.println(svc);
                                     String s = svc.echo("hola!");
                                     System.out.println(s);
                                     }
                                     catch (Exception e) {
                                     e.printStackTrace();
                                     }
                                     }
                                    }
                                    


                                    To generate the client with wscompile, you have to have your web service running, of course.

                                    Good luck and cheers !!
                                    Jose Manuel


                                    1 2 Previous Next