[jdom-interest] using JDOM with Tomcat

Jacques Capesius jacques_capesius at cnt.com
Wed Mar 12 13:55:42 PST 2003


Hi folks, 

I apologize in advance if you get bombarded with questions like this, but
I'm hoping someone here could figure out what I'm doing wrong. 

I have the latest jdom.jar in my WEB-INF/lib directory. I can use the JDOM
classes just fine in jsps that I write. The pages compile on tomcat and run
just fine.

The problem is when I try to make a servlet or a java class to run as a bean
within a JSP. For example, the below class...

package PSQ;
import org.jdom.*;

public class PSQ_XML 
{
  public Document returnIt(Document doc)
  {
    org.jdom.input.DOMBuilder xfer = new org.jdom.input.DOMBuilder();  
    return doc;
  }
}

... compiles just fine with javac, but throws...

javax.servlet.ServletException: org/jdom/input/DOMBuilder 

...when I try to instantiate the xfer variable.

I'm not quite sure why this same line of code would run just fine within a
jsp page, and throw the error when run from a servlet. 

Does anybody know what I need to do to get the class to work?

thanks a million

-jacques :)



More information about the jdom-interest mailing list