Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: org/apache/axis2/client/Stub

I've added a Web Service using Axis2 to my project and now I can't run my application.

This is the classpath I am using:

<property name="classpath" location="bin:EventReservationCore/bin:EventReservationCore/db:EventReservationCore/lib/*:EventReservationCore/lib/util_iso2.jar:EventReservationCore/lib/sqlitejdbc-v056.jar:AuthorizationRMI/lib/AuthorizationService.jar:EventReservationCore/lib/activemq-all-5.4.3.jar:/home/ander/axis2-1.6.1/webapp/axis2.war"/>

And this is the target that runs until I add the Axis2 Web Service.

<target name="run.besocial">
            <java classname="eventReservationServer.ReservationEventServer" classpath="${classpath}" fork="true">
                <jvmarg value="-Djava.rmi.server.codebase=file:EventReservationCore/bin/ file:EventReservationCore/lib/util_iso2.jar"/>
                <jvmarg value="-Djava.security.policy=EventReservationCore/java.policy" />
            </java>
    </target>

As a result I get this error:

 [java] Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis2/client/Stub
 [java]     at java.lang.ClassLoader.defineClass1(Native Method)
 [java]     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
 [java]     at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
 [java]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
 [java]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
 [java]     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
 [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
 [java]     at java.security.AccessController.doPrivileged(Native Method)
 [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 [java]     at eventReservationServer.eventServerGateway.WSEventServerGateway.getEvents(WSEventServerGateway.java:19)
 [java]     at eventReservationServer.ReservationEventServer.<init>(ReservationEventServer.java:101)
 [java]     at eventReservationServer.ReservationEventServer.main(ReservationEventServer.java:130)
 [java] Caused by: java.lang.ClassNotFoundException: org.apache.axis2.client.Stub
 [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 [java]     at java.security.AccessController.doPrivileged(Native Method)
 [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 [java]     ... 15 more
like image 945
user1314836 Avatar asked Aug 17 '26 06:08

user1314836


1 Answers

If you are using tomcat, copy all the jar files located under axis2/lib folder to the tomcat/lib folder and also add them to the classpath like this D:\axis2-1.6.2\lib*

like image 143
rookie_ron Avatar answered Aug 18 '26 19:08

rookie_ron