• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in jar file

 
Krithi Raghu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed a web service and have got an ear file. The client to invoke this is built into a jar file. When i try to run this jar file, using java -jar client.jar, I am getting -

"Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler".

In the Class-Path attribute of my manifest file i have provided xerces.jar. But still it is unable to pick up the xerces.jar file. Where am I going wrong in this?

Please help !!!
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the entry states:


then xerces.jar needs to be in the same directory as client.jar. If it states a path then xerces.jar must be in that location.

Adding Classes to the JAR File's Classpath

Apache's Xerces implementation actually splits into xml-apis.jar and xercesImpl.jar and org.xml.sax.helpers.DefaultHandler is in xml-apis.jar - so make sure that your xerces.jar actually contains org.xml.sax.helpers.DefaultHandler.

Also make sure the right xerces.jar is used. The Class-Path is ignored if there is a xerces.jar in the SDK ext subdirectory.

How the Java Launcher Finds JAR-class-path Classes
 
Krithi Raghu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Peer.

I resolved it by keeping the xerces.jar file in the current directory.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!