Strange Java XML Tomcat Problem

T

Tom Dyess

I created an RSS news feed reader that loads xml from a URL to a pre-formed
class structure. It loads just fine when Debuged in Eclipse 3.0.1 by
debugging the main() procedure, but when I try to run it in tomcat, I get
this:

java.lang.NoSuchMethodError:
org.w3c.dom.Node.getTextContent()Ljava/lang/String;


The call that is causing it is this:

pubDate = node.getTextContent();

From what I understand, this method is new to Java 1.5 (not in 1.4). Why
would it work in Eclipse but not Tomcat installed on the same machine? I
downloaded Xerces 2.6.2 and put the 2 .jars in $TOMCAT/common/endorsed and
it still doesn't work.

Thanks,
Tom
 
T

Tom Dyess

Tom Dyess said:
I created an RSS news feed reader that loads xml from a URL to a pre-formed
class structure. It loads just fine when Debuged in Eclipse 3.0.1 by
debugging the main() procedure, but when I try to run it in tomcat, I get
this:

java.lang.NoSuchMethodError:
org.w3c.dom.Node.getTextContent()Ljava/lang/String;


The call that is causing it is this:

pubDate = node.getTextContent();

From what I understand, this method is new to Java 1.5 (not in 1.4). Why
would it work in Eclipse but not Tomcat installed on the same machine? I
downloaded Xerces 2.6.2 and put the 2 .jars in $TOMCAT/common/endorsed and
it still doesn't work.

Thanks,
Tom

Upgrading to Tomcat 5.5 solved the problem. I'm curious as to why replacing
the Xerces libs in /common/endorsed didn't solve the problem.
 
Joined
Apr 6, 2010
Messages
1
Reaction score
0
Wrong library

The incompatible Node class is actually in the xml-apis library, not xerces (e.g. xml-apis-2.5.0.jar).

We removed xml-apis-2.5.0.jar from the endorsed directory in Stellent Content Server (Oracle Universal Content Management 10gR3) - which uses Tomcat as its embedded servlet container - to work around this problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top