Skip to main content

exporting web service client from eclipse

2 replies [Last post]
falkonaken
Offline
Joined: 2008-08-25
Points: 0

Hi,

I am developing a program based on Web Services. Server part is OK. I am developing a java client for one method of the Web Service. I am using eclipse as IDE.
Basically, the client is a java main class that is listenning to an UDP port and at data arrival, a call has to be made to the corresponding method of the web service.
If a run this class with Eclipse as Java bean or as java application it works perfect but I can´t find the way of running it out of eclipse, I mean, in a linux server or my own windows command line.

If I export the project as jar and execute I get this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service
at java.lang.ClassNotFoundException: javax.xml.rpc.ServiceException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.defineClass(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 java.lang.ClassLoader.loadClassInternal(Unknown Source)

Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
utteshkumar
Offline
Joined: 2008-08-26
Points: 0

did u added the support jars to your created jar ? check if not add those jar ..or
copy all support jars to the project folder outside eclipse and run the classes

santiago_762000
Offline
Joined: 2009-03-25
Points: 0

In addition, you can create a servlet, which calls to the webservice(instead of your main class). Next, you would create a class, which calls to this servlet using java.net.URL.