简体   繁体   中英

NoClassDefinitionFound: javax.xml.ws.Service

I am building a Java Web Service Client application that interacts with a web service in JDeveloper.

I build the web proxy using wizard for Web Service Proxy creation.

I am using JAX-WS method for web service interaction.

When i run this code from the IDE, it runs fine. but when i try to run it using a jar it fails.

Reports me error NoClassDefinitionFound: javax.xml.ws.Service

Please tell me the required number of jar files (or xmls) i need to include in building client jar so that it can run successfully!!

When you run it as a jar, you need to specify the classpath to the JAX-WS dependency using

java -cp classpath1:classpath2 -jar yourApplication.jar

You can also permanently add the location of the JAX-WS dependency to the PATH environment variable on your system, or whatever system from which you will be running the application. If you do that, you will NOT have to type the following command every time you wish to run the application:

-cp classpath1:classpath2 -jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM