Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
ngo thanhson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this error message when deploying a JSP: java.lang.NoClassDefFoundError: org/apache/soap/rpc/RPCMessage

This error points to the line " gs=new GoogleSearch();" where GoogleSearch is a defined class. I tested it on my local computer and it worked well.

Do you have any idea what type of exception is this ? Thank you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like your app is missing a jar file.

Which jar on your local machine contains:
org/apache/soap/rpc/RPCMessage?
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set org.apache.soap.rpc.RPCMessage and other dependent classes in classpath.

One easy way is place your jar containing these classes in application lib folder.

Second import your GoogleSeearch class in jsp by page directive




Naseem
 
ngo thanhson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's great. It worked. I missed a jar file, so I copied it into WEB-INF/lib. Btw, why do we need a jar file because I unziped it already? I thought that I we only need the .class file inorder to call third-party class.

Thank you so much.
[ July 06, 2006: Message edited by: ngo thanhson ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may have unzipped it in the wrong place.
Anyway, you should not unzip jar files
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ngo thanhson:
I thought that I we only need the .class file inorder to call third-party class.


If you want to extract the class, you need to make sure you put the file in the correct place (WEB-INF/classes/{full package structure}/class).

Also, that class may or may not have dependencies of it's own.
There is a good chance that those dependencies are not going to be listed in the author's documentation if they are all included in the jar file.
IOW: Unless you have a real good reason to do so, don't unpack the jar file.
 
The moustache of a titan! The ad of a flea:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!