Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang. NoClassDefFoundError

 
Ravi Pat
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ravi Pat
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic