Link to home
Start Free TrialLog in
Avatar of srikanthradix
srikanthradixFlag for United States of America

asked on

java.lang.ClassNotFoundError ClassName - Please suggest

My Web Application is giving an error in SysErr.log file
java.lang.NoClassDefFoundError: org/jdom/output/Format

But, I already have
"jaxen-core.jar" "jaxen-jdom.jar" "jdom.jar" "saxpath.jar" "xalan.jar" "xerces.jar" "xml-apis.jar" in my "build path of the project."

where jdom.jar has org.jdom.output.Format.

And what is weird is that "It would have given compilation error if it isn't present in the project. But it is giving the runtime error saying NoClassDefFoundError Format." Please suggest why is this happening & What to do to avoid this in WebSphere?
Format format = Format.getCompactFormat();
XMLOutputter xout = new XMLOutputter(format);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srikanthradix

ASKER

I did a System.getProperty("java.class.path") and pasted all those jar files at that location. Thanks a bunch, it worked and also the method you told for unformatting xml.
:-)