File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes java.lang.VerifyError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "java.lang.VerifyError" Watch "java.lang.VerifyError" New topic


ketan khairnar

Joined: Dec 21, 2004
Posts: 15
Hi All,
We are porting one customised product built on java 1.2 from apache1.3-tomcat 4.0 to apache 2.0-tomcat 5.0.
I am using virtual host to map uri to application mentioned above.
Also we need to copy xerces.jar, mail.jar,jndi.jar in common/lib of tomcat.
When I copied same old jars in common/lib of new tomcat(5.0) dir and invoked the servlet I am getting this error

I found answer somewhere as

Your servlet runner runs a too old version of the org.w3c.dom package, e.g. like Tomcat 3.2.3.
In this case, you need to upgrade your servlet runner to a newer version.

I ma not getting anything.
Please someone resolve my query to atleast understand what is actual problem.
Ketan K
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Like the error message says, you have a library version conflict. The Java standard library has had the org.w3c.dom package since version 1.4 so your attempt to use old xerces.jar is completely incompatible.
The best solution would be to compile your customized product with the latest Java 1.5, using only the built in XML library. This will probably involve some effort because the XML interfaces have been cleaned up alot since the era of Java 1.2.
ketan khairnar

Joined: Dec 21, 2004
Posts: 15
After all I got the clue for error as follows

XML Parsers and JDK 1.4
Among many other changes, the JDK 1.4 release packages the JAXP APIs, and a version of Xerces, inside the JDK. This has impacts on applications that wish to use their own XML parser.

In previous versions of Tomcat 5, you could simply replace the XML parser in the $CATALINA_HOME/common/lib directory to change the parser used by all web applications. However, this technique will not be effective when you are running on JDK 1.4, because the usual class loader delegation process will always choose the implementation inside the JDK in preference to this one.

JDK 1.4 supports a mechanism called the "Endorsed Standards Override Mechanism" to allow replacement of APIs created outside of the JCP (i.e. DOM and SAX from W3C). It can also be used to update the XML parser implementation. For more information, see:

Tomcat utilizes this mechanism by including the system property setting -Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed in the command line that starts the container. Therefore, you can replace the parser that is installed in this directory, and it will get used even on a JDK 1.4 system

Has anybody done this before? need some help in this regard
I agree. Here's the link:
subject: java.lang.VerifyError
It's not a secret anymore!