Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
naval kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,

When I m Executing my Code In Side Of Public Static Void main(String arg[])Its Working Fine But When I am executing the code inside of apache Tomcat its Throwing Error

java.lang.NoClassDefFoundError: com/sun/org/apache/xml/security/Init
org.jcp.xml.dsig.internal.dom.DOMXMLSignature.<clinit>(DOMXMLSignature.java:54)
org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.unmarshalXMLSignature(DOMXMLSignatureFactory.java:118)
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's simple one,
check if you have xmlsec.jar uploaded to your tomcat.
 
naval kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are Genius, My problem has been resolved but how did you find the solution Because the problem is showing com/sun/org/apache/xml/security/Init Security type issue but the problem in this jar xmlsec.jar.
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's common problem/question on our java hosting support desk, so don't worry too much and trust me, you're not the only one that struggled with this issue
 
utsav gupta
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi

I would rather like to continue to discuss on this topic than to create a new post. I hope that is allowed. Because this was precisely the problem that I was facing.
I wish to know as to why is it that If i run the application as a simple Java application then I am able to run the application through eclipse but If I wish to run the same code as a web application I have to copy all the required jar files into the Tomcat container. Is it not the task of eclipse or Tomcat to pick up the dependent libraries from the classpath rather than for us to manually put it there??
Or Am I missing some configuration in eclipse.

Kindly Reply
Regards
Utsav.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic