[jdom-interest] java.lang.NoSuchMethodError when using tomcat

Otavio Rezende da Silva otaviors at hotmail.com
Wed Nov 15 06:57:28 PST 2000


Philip,

I've also experienced this problem. This happens beacause Tomcat's got an 
embeded XML parser. I guess it's located in a directory called lib, in a 
file called XML.jar.
This parser is based on the release 1 of DOM, and JDOM needs to be used with 
the 2nd release. To correct this problem You will have to replace the 
org.w3c.dom files of this package by the 2nd release ones. You can do that 
opening the jar file using a zip tool (WinZip for example) and adding the 
DOM rel 2 files. As you said the application is running well outside the 
webserver, you must have the files somewhere in your classpath.

Cheers,

Otavio Silva

>From: Philipp Zuderell <philipp.zuderell at tanner.de>
>To: jdom-interest at jdom.org
>Subject: [jdom-interest] java.lang.NoSuchMethodError when using tomcat
>Date: Wed, 15 Nov 2000 14:35:47 +0100
>
>Hi all,
>
>I have written an application that parses an XML-file using jdom and
>DOMBuilder.
>When I changed the application into a Servlet, I get the following error
>Message when I try to build the document from the XML-file:
>
>
>Error: 500
>Location: /examples/servlet/ResponseCreator
>Internal Servlet Error:
>
>java.lang.NoSuchMethodError: org.w3c.dom.DocumentType: method
>getPublicId()Ljava/lang/String; not found
>  at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java, Compiled Code)
>  at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java, Compiled Code)
>  at org.jdom.input.DOMBuilder.build(DOMBuilder.java:191)
>  at org.jdom.input.DOMBuilder.build(DOMBuilder.java:216)
>  at HandleXML.XMLCreator(HandleXML.java:52)
>  at ResponseCreator.doPost(ResponseCreator.java:43)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
>org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
>Compiled Code)
>  at
>org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
>
>  at
>org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
>
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
>org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
>Compiled Code)
>  at
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>  at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
>
>  at
>org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
>
>  at java.lang.Thread.run(Unknown Source)
>
>
>I have no clue what the error might be as the same code works fine when
>run as an application.
>I use jdom beta4 (tried beta5, too) and tomcat 3.1 embedded with apache
>1.3.14.
>
>Thanks for reading this, any help is appreciated.
>
>Philipp
>
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.




More information about the jdom-interest mailing list