Hi there
I am working with a Web Service (using Axis2) and I created a java client (called Test2)
But I've got a problem when I run the client class
to get it going I use the command
"Java-Djava.ext.dirs = c: / temp / lib Test2"
from what I understand with the command -D I set a system property... and in this case I am saying that there are external libraries that must go get in the folder "c: / temp / lib"
with this command, before returning the desired output of the WS, console comes out the message
and thanks to the commandCode:[INFO] Deploying module: MetadataExchange-1.5.1 - file: / C: / Temp/lib/mex-1.5.1. jar
(I print to video all "system properties" one by one)Code:
System.getProperties (). List (System.out);
I can see that the "java.ext.dirs" is given the path "c: / temp / lib"
What I would do would be to simply run the client Test2 without setting the properties by the console, if this is necessary i prefer setting properties in the code, and I've tried it...
I imported "java.util.Properties" and I used the command
Now running the file with "java Test2" I see the "java.ext.dirs" is given the correct path I wanted to give it but I did not print the console lineCode:System.setProperty ("java.ext.dirs", "c: / temp / lib");
and the program ends with an errorCode:[INFO] Deploying module: MetadataExchange-1.5.1 - file: / C: / Temp/lib/mex-1.5.1.jar
someone from the forum has some ideas that I could be closer to solving the problem?Code:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis2/client/Stub
java.lang.ClassLoader.defineClass1 at (Native Method)
java.lang.ClassLoader.defineClassCond at (Unknown Source)
at java.lang.ClassLoader.defineClass (Unknown Source)
at java.security.SecureClassLoader.defineClass (Unknown Source)
at java.net.URLClassLoader.defineClass (Unknown Source)
at java.net.URLClassLoader.access $ 000 (Unknown Source)
at java.net.URLClassLoader $ 1.run (Unknown Source)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (Unknown Source)
at java.lang.ClassLoader.loadClass (Unknown Source)
at sun.misc.Launcher $ AppClassLoader.loadClass (Unknown Source)
at java.lang.ClassLoader.loadClass (Unknown Source)
at Test2.client (Test2.java: 26)
at Test2.main (Test2.java: 64)
Caused by: java.lang.ClassNotFoundException: org.apache.axis2.client.Stub
at java.net.URLClassLoader $ 1.run (Unknown Source)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (Unknown Source)
at java.lang.ClassLoader.loadClass (Unknown Source)
at sun.misc.Launcher $ AppClassLoader.loadClass (Unknown Source)
at java.lang.ClassLoader.loadClass (Unknown Source)
... 14 more
Thanks for your patience even to have read :)
Bye

