wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes java.lang. NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "java.lang. NoClassDefFoundError" Watch "java.lang. NoClassDefFoundError" New topic
Author

java.lang. NoClassDefFoundError

Ravi Pat
Greenhorn

Joined: Oct 04, 2004
Posts: 15
Hello all:
I'm using Eclipse with Struts framework and am trying to create and convert a SVG graphic to JPG. This is the error that i've been getting:

java.lang.NoClassDefFoundError rg/apache/batik/dom/svg/ExtensibleSVGDOMImplementation

Now I've made sure multiple times to import the jar file. I'm deploying my application on the JBoss server and find this jar file in JBoss deploy directory too when I deploy the application. But the same error persists. I have had a couple of NoClassDefFound errors before, and I corrected them the same way, by importing the jar file into the WEB-APP/lib directory of my application. They worked, but this error is adamant !!

Any ideas anyone? Also, my apologies if I've posted this in the wrong forum.
Thanks
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Ravi Pat:
They worked, but this error is adamant !!

, Good comment.

Have you installing the latest package from batik ??
Other suggestion could be write small function and see whether the class exist or not.
Class classExists(String classname) {
try {
return Class.forName(classname);
} catch (ClassNotFoundException e) {
return null;
}
}


Or you can try to instantiate a object of it from a jsp or servlet and see whether its works


Spritle Software Blogs
Ravi Pat
Greenhorn

Joined: Oct 04, 2004
Posts: 15
Balaji...thanks for your reply. Actually, i wasn't importing all the jar files into the run-time classpath. Its kinda strange, coz the error that I mentioned before persisted for a long time until I decided to use all the jar files that came with Batik. And presto..it worked.

I suspect, the problem was being caused because some of the jar files might be interdependent, but i'm not sure. Perhaps someone worked extensively with Batik might comment.

But now here's the thing...all my SVG-XML was rasterized to JPG just fine, however it shows JPGs as broken images. I thought it would leave JPGs alone, but apparently it tries to rasterize those too. Any ideas on this?

Thanks everyone..
best
ravi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang. NoClassDefFoundError
 
Similar Threads
Application Container in JBOSS4.3
Running a Java client that connects to EJBs deployed on WAS 7 without stubs
Issue with jboss\lib\endorsed jar loading
Error while migrating from SUN One to JBOSS
How to deploy a Simple EJB application?