I want a servlet generated XML document to be displayed in an applet. But when I am using the HandlerBase class of org.xml.sax package in the applet it throws a ClassNotFoundException even after importing the proper packages. This happens only in the browser, in the applet viewer the applet displays the parsed XML. How do I solve the problem?

Luigi Viggiano

This should be because some jar's class is missing; add all the needed jars (xerces.jar for example) to the classpath of the servlet-engine.

Check the SAX version and all xml jars too. Maybe your servlet engine is using an older one (maybe because the order of the jars in the classpath is wrong).

Try to open the jar of the servlet engine and check if it contains SAX classes. If yes, put the jar containing your (updated) sax classes before the jar of the servlet engine on its startup command. Note that inside xerces.jar, sax classes are included. So... try to put xerces.jar before the servlet engine's jars.
If the problems persists, try to put xerces as the first jar in the classpath.


java -cp servletEngine.jar;...;xerces.jar;... servletEngine.Server

java -cp xerces.jar;servletEngine.jar;... servletEngine.Server

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact