Discussion:
Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Warren Bell
2011-12-09 21:47:54 UTC
Permalink
Hello Tomcat Users,

I am having a problem with xerces and other jars in the JDK or Tomcat
conflicting with jars in my app. I am getting the following exception
when instantiating Smooks, a csv library that usese xerces, in a web app
running in Tomcat:

java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler

I found something in the Tomcat docs and at Oracle about "Endorsed
Standards Override Mechanism".

http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

So I followed the directions and placed the jaxen-1.1.1.jar in the
Tomcat endorsed directory. I ran the app again and got a diferent exception:

org.apache.xerces.impl.dv.DVFactoryException: DTD factory class
org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from
DTDDVFactory.

I then placed xercesImpl-2.6.2.jar in the Tomcat endorsed directory. I
ran the app again and got a diferent exception:

java.lang.NoSuchMethodError:
org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V

This makes me think I am on the right track and the exceptions I am
getting seem to point to the wrong classes being loaded.

My question is, is their a set of XML related jars that I should take
out of my app and place in this endorsed directory or is there a
different way of fixing this problem ?

Thanks,

Warren Bell
Christopher Schultz
2011-12-12 19:49:29 UTC
Permalink
Warren,
Post by Warren Bell
This makes me think I am on the right track and the exceptions I
am getting seem to point to the wrong classes being loaded.
Maybe, but maybe not.
Post by Warren Bell
My question is, is their a set of XML related jars that I should
take out of my app and place in this endorsed directory or is there
a different way of fixing this problem ?
What other JARs do you have in your webapp?

Also, what's the full stack trace of these exceptions? If you place
things into "endorsed" then they will plug-into JAXP which means that
Tomcat will use them internally to load things (like server.xml) and
so you'll need to have all dependencies (like xml-apis.jar for
instance) in that endorsed directory, too. Otherwise, you could get
weird stuff like this happening.

- -chris
Warren Bell
2011-12-13 03:26:24 UTC
Permalink
Here are all the jars in my app. There are a lot. The jars that came in
as dependencies of smooks are:

milyn-smooks-csv-1.5.jar
openscv-1.8.jar
milyn-smooks-flatfile-1.5.jar
milyn-smooks-javabean-1.5.jar
milyn-smooks-core-1.5.jar
milyn-commons-1.5.jar
freemaker-2.3.15.jar
javassist-3.10.0.GA.jar
xstream-1.4.1.jar
xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
mvel2-2.0.17.jar
jaxen-1.1.1.jar
xercesImpl-2.6.2.jar
jta-1.1.jar

All of the other jars in my app:

activation-1.1.jar mvel2-2.0.17.jar
antlr-2.7.2.jar opencsv-1.8.jar
aopalliance-1.0.jar oro-2.0.8.jar
aspectjrt-1.6.1.jar postgresql-8.3-603.jdbc3.jar
aspectjweaver-1.6.1.jar servlet-api-2.3.jar
cglib-nodep-2.1_3.jar servlet-api-2.5.jar
commons-beanutils-1.7.0.jar slf4j-api-1.5.8.jar
commons-chain-1.1.jar slf4j-log4j12-1.5.10.jar
commons-codec-20041127.091804.jar spring-2.5.6.SEC01.jar
commons-collections-3.2.1.jar spring-aspects-2.5.6.SEC01.jar
commons-dbcp-all-1.3-r699049.jar spring-beans-2.0.8.jar
commons-digester-1.8.jar spring-context-2.0.8.jar
commons-email-1.1.jar spring-core-2.0.8.jar
commons-exec-1.0.jar spring-dao-2.0.8.jar
commons-io-1.4.jar spring-ibatis-2.0.8.jar
commons-lang-2.4.jar spring-jdbc-2.0.8.jar
commons-logging-1.1.jar sslext-1.2-0.jar
commons-math-2.0.jar struts-core-1.3.8.jar
commons-validator-1.3.1.jar struts-taglib-1.3.8.jar
cron4j-2.2.3.jar struts-tiles-1.3.8.jar
dom4j-1.1.jar swarm-1.4-rc1.jar
edtFTPj-2.0.4.jar velocity-1.6.1.jar
freemarker-2.3.15.jar velocity-tools-2.0-beta3.jar
hive-1.4-rc1.jar wasp-1.4-rc1.jar
ibatis-sqlmap-2.3.0.jar webservices-api.jar
inmethod-grid-1.4.2-SNAPSHOT.jar webservices-extra-api.jar
javassist-3.10.0.GA.jar webservices-extra.jar
jaxen-1.1.1.jar webservices-rt.jar
jconn2-1.jar wicket-1.4.7.jar
joda-time-1.6.jar wicket-datetime-1.4.7.jar
jta-1.1.jar wicket-extensions-1.4.7.jar
junit-3.8.1.jar wicket-ioc-1.4.7.jar
log4j-1.2.14.jar wicket-spring-1.4.7.jar
mail-1.4.jar wicket-spring-annot-1.3.5.jar
milyn-commons-1.5.jar wicomsec-1.4-rc1.jar
milyn-smooks-core-1.5.jar wiquery-1.0.1.jar
milyn-smooks-csv-1.5.jar xercesImpl-2.6.2.jar
milyn-smooks-flatfile-1.5.jar xmlpull-1.1.3.1.jar
milyn-smooks-javabean-1.5.jar xpp3_min-1.1.4c.jar
minis-1.4.1.jar xstream-1.4.1.jar

I am using Maven to manage my apps dependencies. My app does not depend
directly on some of these jars, like the struts jars. They got dragged
in as dependencies of something else. As for the exception:

java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler
at org.jaxen.saxpath.base.XPathReader.parse(XPathReader.java:98)
at
org.milyn.cdr.xpath.SelectorStepBuilder._buildSteps(SelectorStepBuilder.java:110)
at
org.milyn.cdr.xpath.SelectorStepBuilder.<clinit>(SelectorStepBuilder.java:43)
at
org.milyn.cdr.SmooksResourceConfiguration.setSelector(SmooksResourceConfiguration.java:447)
at
org.milyn.cdr.SmooksResourceConfiguration.<init>(SmooksResourceConfiguration.java:304)
at
org.milyn.cdr.SmooksResourceConfigurationStore.addHandlerFactoryConfig(SmooksResourceConfigurationStore.java:143)
at
org.milyn.cdr.SmooksResourceConfigurationStore.registerInstalledHandlerFactories(SmooksResourceConfigurationStore.java:139)
at
org.milyn.cdr.SmooksResourceConfigurationStore.<init>(SmooksResourceConfigurationStore.java:112)
at
org.milyn.container.standalone.StandaloneApplicationContext.<init>(StandaloneApplicationContext.java:59)
at org.milyn.Smooks.<init>(Smooks.java:118)
at org.milyn.Smooks.<init>(Smooks.java:170)
at
com.scanman.cron.task.ImportPriceChangesFromSupplier.executeTask(ImportPriceChangesFromSupplier.java:70)
at com.scanman.cron.task.ScanManTask.execute(ScanManTask.java:79)
at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)

This is the first exception thrown before I started moving jars around
into the endorsed folder. The endorsed folder is empty when this
exception is thrown.

Thanks,

Warren Bell
Post by Christopher Schultz
Warren,
Post by Warren Bell
This makes me think I am on the right track and the exceptions I
am getting seem to point to the wrong classes being loaded.
Maybe, but maybe not.
Post by Warren Bell
My question is, is their a set of XML related jars that I should
take out of my app and place in this endorsed directory or is there
a different way of fixing this problem ?
What other JARs do you have in your webapp?
Also, what's the full stack trace of these exceptions? If you place
things into "endorsed" then they will plug-into JAXP which means that
Tomcat will use them internally to load things (like server.xml) and
so you'll need to have all dependencies (like xml-apis.jar for
instance) in that endorsed directory, too. Otherwise, you could get
weird stuff like this happening.
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Mark Eggers
2011-12-13 03:50:11 UTC
Permalink
----- Original Message -----
Sent: Monday, December 12, 2011 7:26 PM
Subject: Re: Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Here are all the jars in my app. There are a lot. The jars that came in
milyn-smooks-csv-1.5.jar
openscv-1.8.jar
milyn-smooks-flatfile-1.5.jar
milyn-smooks-javabean-1.5.jar
milyn-smooks-core-1.5.jar
milyn-commons-1.5.jar
freemaker-2.3.15.jar
javassist-3.10.0.GA.jar
xstream-1.4.1.jar
xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
mvel2-2.0.17.jar
jaxen-1.1.1.jar
xercesImpl-2.6.2.jar
jta-1.1.jar
activation-1.1.jar            mvel2-2.0.17.jar
antlr-2.7.2.jar                opencsv-1.8.jar
aopalliance-1.0.jar            oro-2.0.8.jar
aspectjrt-1.6.1.jar            postgresql-8.3-603.jdbc3.jar
aspectjweaver-1.6.1.jar            servlet-api-2.3.jar
cglib-nodep-2.1_3.jar            servlet-api-2.5.jar
commons-beanutils-1.7.0.jar        slf4j-api-1.5.8.jar
commons-chain-1.1.jar            slf4j-log4j12-1.5.10.jar
commons-codec-20041127.091804.jar    spring-2.5.6.SEC01.jar
commons-collections-3.2.1.jar        spring-aspects-2.5.6.SEC01.jar
commons-dbcp-all-1.3-r699049.jar    spring-beans-2.0.8.jar
commons-digester-1.8.jar        spring-context-2.0.8.jar
commons-email-1.1.jar            spring-core-2.0.8.jar
commons-exec-1.0.jar            spring-dao-2.0.8.jar
commons-io-1.4.jar            spring-ibatis-2.0.8.jar
commons-lang-2.4.jar            spring-jdbc-2.0.8.jar
commons-logging-1.1.jar            sslext-1.2-0.jar
commons-math-2.0.jar            struts-core-1.3.8.jar
commons-validator-1.3.1.jar        struts-taglib-1.3.8.jar
cron4j-2.2.3.jar            struts-tiles-1.3.8.jar
dom4j-1.1.jar                swarm-1.4-rc1.jar
edtFTPj-2.0.4.jar            velocity-1.6.1.jar
freemarker-2.3.15.jar            velocity-tools-2.0-beta3.jar
hive-1.4-rc1.jar            wasp-1.4-rc1.jar
ibatis-sqlmap-2.3.0.jar            webservices-api.jar
inmethod-grid-1.4.2-SNAPSHOT.jar    webservices-extra-api.jar
javassist-3.10.0.GA.jar            webservices-extra.jar
jaxen-1.1.1.jar                webservices-rt.jar
jconn2-1.jar                wicket-1.4.7.jar
joda-time-1.6.jar            wicket-datetime-1.4.7.jar
jta-1.1.jar                wicket-extensions-1.4.7.jar
junit-3.8.1.jar                wicket-ioc-1.4.7.jar
log4j-1.2.14.jar            wicket-spring-1.4.7.jar
mail-1.4.jar                wicket-spring-annot-1.3.5.jar
milyn-commons-1.5.jar            wicomsec-1.4-rc1.jar
milyn-smooks-core-1.5.jar        wiquery-1.0.1.jar
milyn-smooks-csv-1.5.jar        xercesImpl-2.6.2.jar
milyn-smooks-flatfile-1.5.jar        xmlpull-1.1.3.1.jar
milyn-smooks-javabean-1.5.jar        xpp3_min-1.1.4c.jar
minis-1.4.1.jar                xstream-1.4.1.jar
I am using Maven to manage my apps dependencies. My app does not depend
directly on some of these jars, like the struts jars. They got dragged
java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler
    at org.jaxen.saxpath.base.XPathReader.parse(XPathReader.java:98)
    at
org.milyn.cdr.xpath.SelectorStepBuilder._buildSteps(SelectorStepBuilder.java:110)
    at
org.milyn.cdr.xpath.SelectorStepBuilder.<clinit>(SelectorStepBuilder.java:43)
    at
org.milyn.cdr.SmooksResourceConfiguration.setSelector(SmooksResourceConfiguration.java:447)
    at
org.milyn.cdr.SmooksResourceConfiguration.<init>(SmooksResourceConfiguration.java:304)
    at
org.milyn.cdr.SmooksResourceConfigurationStore.addHandlerFactoryConfig(SmooksResourceConfigurationStore.java:143)
    at
org.milyn.cdr.SmooksResourceConfigurationStore.registerInstalledHandlerFactories(SmooksResourceConfigurationStore.java:139)
    at
org.milyn.cdr.SmooksResourceConfigurationStore.<init>(SmooksResourceConfigurationStore.java:112)
    at
org.milyn.container.standalone.StandaloneApplicationContext.<init>(StandaloneApplicationContext.java:59)
    at org.milyn.Smooks.<init>(Smooks.java:118)
    at org.milyn.Smooks.<init>(Smooks.java:170)
    at
com.scanman.cron.task.ImportPriceChangesFromSupplier.executeTask(ImportPriceChangesFromSupplier.java:70)
    at com.scanman.cron.task.ScanManTask.execute(ScanManTask.java:79)
    at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:680)
This is the first exception thrown before I started moving jars around
into the endorsed folder. The endorsed folder is empty when this
exception is thrown.
Thanks,
Warren Bell
Post by Christopher Schultz
Warren,
Post by Warren Bell
This makes me think I am on the right track and the exceptions I
am getting seem to point to the wrong classes being loaded.
Maybe, but maybe not.
Post by Warren Bell
My question is, is their a set of XML related jars that I should
take out of my app and place in this endorsed directory or is there
a different way of fixing this problem ?
What other JARs do you have in your webapp?
Also, what's the full stack trace of these exceptions? If you place
things into "endorsed" then they will plug-into JAXP which means
that
Post by Christopher Schultz
Tomcat will use them internally to load things (like server.xml) and
so you'll need to have all dependencies (like xml-apis.jar for
instance) in that endorsed directory, too. Otherwise, you could get
weird stuff like this happening.
-chris
If you're using Maven to manage the dependencies, how about marking the offending jars <scope>provided</scope>, and see if the later versions provided in the JRE (and in Tomcat for the servlet spec) meet the expected requirements.

Your IDE should be happy with it (at least NetBeans and Eclipse would be), and Maven will not include those jars in your war file.

. . . . just a thought.
/mde/
Caldarale, Charles R
2011-12-13 03:57:55 UTC
Permalink
Subject: Re: Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Post by Warren Bell
servlet-api-2.3.jar
servlet-api-2.5.jar
If you're using Maven to manage the dependencies, how about
marking the offending jars <scope>provided</scope>, and see
if the later versions provided in the JRE (and in Tomcat for
the servlet spec) meet the expected requirements.
At the very least, the OP _must_ remove the servlet-api*.jar files; they are provided by the container and can never be placed in WEB-INF/lib. (But they're not the cause of the XML problem, just another symptom.)

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Martin Gainty
2011-12-13 11:56:39 UTC
Permalink
Past weekend I just went thru xerces *e&l% on another Application Server ..turns out they had a DTD specific xerces version that gacked on xsds
The AppServer version of Xerces was buried so far down into the core their solution was to rebuild the server with a version of Xerces that wont fubar on parsing xsds
NB: 99% of the posts I've seen for xerces problems say "delete all versions of xerces from your CLASSPATH"

Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
Date: Mon, 12 Dec 2011 21:57:55 -0600
Subject: RE: Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Subject: Re: Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Post by Warren Bell
servlet-api-2.3.jar
servlet-api-2.5.jar
If you're using Maven to manage the dependencies, how about
marking the offending jars <scope>provided</scope>, and see
if the later versions provided in the JRE (and in Tomcat for
the servlet spec) meet the expected requirements.
At the very least, the OP _must_ remove the servlet-api*.jar files; they are provided by the container and can never be placed in WEB-INF/lib. (But they're not the cause of the XML problem, just another symptom.)
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
Pid *
2011-12-13 06:27:19 UTC
Permalink
Post by Warren Bell
Here are all the jars in my app. There are a lot. The jars that came in
milyn-smooks-csv-1.5.jar
openscv-1.8.jar
milyn-smooks-flatfile-1.5.jar
milyn-smooks-javabean-1.5.jar
milyn-smooks-core-1.5.jar
milyn-commons-1.5.jar
freemaker-2.3.15.jar
javassist-3.10.0.GA.jar
xstream-1.4.1.jar
xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
mvel2-2.0.17.jar
jaxen-1.1.1.jar
xercesImpl-2.6.2.jar
jta-1.1.jar
So I'd guess that anything with an X in its name would go in endorsed,
then I'd refine from there.
Post by Warren Bell
activation-1.1.jar mvel2-2.0.17.jar
antlr-2.7.2.jar opencsv-1.8.jar
aopalliance-1.0.jar oro-2.0.8.jar
aspectjrt-1.6.1.jar postgresql-8.3-603.jdbc3.jar
aspectjweaver-1.6.1.jar servlet-api-2.3.jar
cglib-nodep-2.1_3.jar servlet-api-2.5.jar
Couple of servlet-api jars in there, that you don't want.

You may also be able to persuade Maven to not include some of the
others, if they're not needed.

You should consider upgrading Spring too.


p
Post by Warren Bell
commons-beanutils-1.7.0.jar slf4j-api-1.5.8.jar
commons-chain-1.1.jar slf4j-log4j12-1.5.10.jar
commons-codec-20041127.091804.jar spring-2.5.6.SEC01.jar
commons-collections-3.2.1.jar spring-aspects-2.5.6.SEC01.jar
commons-dbcp-all-1.3-r699049.jar spring-beans-2.0.8.jar
commons-digester-1.8.jar spring-context-2.0.8.jar
commons-email-1.1.jar spring-core-2.0.8.jar
commons-exec-1.0.jar spring-dao-2.0.8.jar
commons-io-1.4.jar spring-ibatis-2.0.8.jar
commons-lang-2.4.jar spring-jdbc-2.0.8.jar
commons-logging-1.1.jar sslext-1.2-0.jar
commons-math-2.0.jar struts-core-1.3.8.jar
commons-validator-1.3.1.jar struts-taglib-1.3.8.jar
cron4j-2.2.3.jar struts-tiles-1.3.8.jar
dom4j-1.1.jar swarm-1.4-rc1.jar
edtFTPj-2.0.4.jar velocity-1.6.1.jar
freemarker-2.3.15.jar velocity-tools-2.0-beta3.jar
hive-1.4-rc1.jar wasp-1.4-rc1.jar
ibatis-sqlmap-2.3.0.jar webservices-api.jar
inmethod-grid-1.4.2-SNAPSHOT.jar webservices-extra-api.jar
javassist-3.10.0.GA.jar webservices-extra.jar
jaxen-1.1.1.jar webservices-rt.jar
jconn2-1.jar wicket-1.4.7.jar
joda-time-1.6.jar wicket-datetime-1.4.7.jar
jta-1.1.jar wicket-extensions-1.4.7.jar
junit-3.8.1.jar wicket-ioc-1.4.7.jar
log4j-1.2.14.jar wicket-spring-1.4.7.jar
mail-1.4.jar wicket-spring-annot-1.3.5.jar
milyn-commons-1.5.jar wicomsec-1.4-rc1.jar
milyn-smooks-core-1.5.jar wiquery-1.0.1.jar
milyn-smooks-csv-1.5.jar xercesImpl-2.6.2.jar
milyn-smooks-flatfile-1.5.jar xmlpull-1.1.3.1.jar
milyn-smooks-javabean-1.5.jar xpp3_min-1.1.4c.jar
minis-1.4.1.jar xstream-1.4.1.jar
I am using Maven to manage my apps dependencies. My app does not depend
directly on some of these jars, like the struts jars. They got dragged
java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler
at org.jaxen.saxpath.base.XPathReader.parse(XPathReader.java:98)
at
org.milyn.cdr.xpath.SelectorStepBuilder._buildSteps(SelectorStepBuilder.java:110)
at
org.milyn.cdr.xpath.SelectorStepBuilder.<clinit>(SelectorStepBuilder.java:43)
at
org.milyn.cdr.SmooksResourceConfiguration.setSelector(SmooksResourceConfiguration.java:447)
at
org.milyn.cdr.SmooksResourceConfiguration.<init>(SmooksResourceConfiguration.java:304)
at
org.milyn.cdr.SmooksResourceConfigurationStore.addHandlerFactoryConfig(SmooksResourceConfigurationStore.java:143)
at
org.milyn.cdr.SmooksResourceConfigurationStore.registerInstalledHandlerFactories(SmooksResourceConfigurationStore.java:139)
at
org.milyn.cdr.SmooksResourceConfigurationStore.<init>(SmooksResourceConfigurationStore.java:112)
at
org.milyn.container.standalone.StandaloneApplicationContext.<init>(StandaloneApplicationContext.java:59)
at org.milyn.Smooks.<init>(Smooks.java:118)
at org.milyn.Smooks.<init>(Smooks.java:170)
at
com.scanman.cron.task.ImportPriceChangesFromSupplier.executeTask(ImportPriceChangesFromSupplier.java:70)
at com.scanman.cron.task.ScanManTask.execute(ScanManTask.java:79)
at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
This is the first exception thrown before I started moving jars around
into the endorsed folder. The endorsed folder is empty when this
exception is thrown.
Thanks,
Warren Bell
Post by Christopher Schultz
Warren,
Post by Warren Bell
This makes me think I am on the right track and the exceptions I
am getting seem to point to the wrong classes being loaded.
Maybe, but maybe not.
Post by Warren Bell
My question is, is their a set of XML related jars that I should
take out of my app and place in this endorsed directory or is there
a different way of fixing this problem ?
What other JARs do you have in your webapp?
Also, what's the full stack trace of these exceptions? If you place
things into "endorsed" then they will plug-into JAXP which means that
Tomcat will use them internally to load things (like server.xml) and
so you'll need to have all dependencies (like xml-apis.jar for
instance) in that endorsed directory, too. Otherwise, you could get
weird stuff like this happening.
-chris
---------------------------------------------------------------------
---------------------------------------------------------------------
Warren Bell
2011-12-16 17:32:25 UTC
Permalink
Tomcat Users,

I Just wanted to get back and let everyone know how I resolved this
issue in case someone else comes against the same type of problem.

First off, it had nothing to do with Tomcat or the JDK. It was a
conflict between two jars that Maven brought into my project with Smooks
and Velocity Tools. Jaxen from Smooks and Dom4j from Velocity Tools both
have the class named org.jaxen.JaxenHandler. In my case
org.jaxen.JaxenHandler from Dom4j got loaded and Smooks tried to use it
instead of the Jaxen version. This resolved into the exception:

java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler

I believed at first it was a conflict with Tomcat. In my case I did not
need Dom4j and I excluded it. Smooks is happy now.

I need to keep my dependencies a little neater and use the exclude tag a
little more often.

Thanks for everyone's help.


Thanks,

Warren Bell
Post by Pid *
Post by Warren Bell
Here are all the jars in my app. There are a lot. The jars that came in
milyn-smooks-csv-1.5.jar
openscv-1.8.jar
milyn-smooks-flatfile-1.5.jar
milyn-smooks-javabean-1.5.jar
milyn-smooks-core-1.5.jar
milyn-commons-1.5.jar
freemaker-2.3.15.jar
javassist-3.10.0.GA.jar
xstream-1.4.1.jar
xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
mvel2-2.0.17.jar
jaxen-1.1.1.jar
xercesImpl-2.6.2.jar
jta-1.1.jar
So I'd guess that anything with an X in its name would go in endorsed,
then I'd refine from there.
Post by Warren Bell
activation-1.1.jar mvel2-2.0.17.jar
antlr-2.7.2.jar opencsv-1.8.jar
aopalliance-1.0.jar oro-2.0.8.jar
aspectjrt-1.6.1.jar postgresql-8.3-603.jdbc3.jar
aspectjweaver-1.6.1.jar servlet-api-2.3.jar
cglib-nodep-2.1_3.jar servlet-api-2.5.jar
Couple of servlet-api jars in there, that you don't want.
You may also be able to persuade Maven to not include some of the
others, if they're not needed.
You should consider upgrading Spring too.
p
Post by Warren Bell
commons-beanutils-1.7.0.jar slf4j-api-1.5.8.jar
commons-chain-1.1.jar slf4j-log4j12-1.5.10.jar
commons-codec-20041127.091804.jar spring-2.5.6.SEC01.jar
commons-collections-3.2.1.jar spring-aspects-2.5.6.SEC01.jar
commons-dbcp-all-1.3-r699049.jar spring-beans-2.0.8.jar
commons-digester-1.8.jar spring-context-2.0.8.jar
commons-email-1.1.jar spring-core-2.0.8.jar
commons-exec-1.0.jar spring-dao-2.0.8.jar
commons-io-1.4.jar spring-ibatis-2.0.8.jar
commons-lang-2.4.jar spring-jdbc-2.0.8.jar
commons-logging-1.1.jar sslext-1.2-0.jar
commons-math-2.0.jar struts-core-1.3.8.jar
commons-validator-1.3.1.jar struts-taglib-1.3.8.jar
cron4j-2.2.3.jar struts-tiles-1.3.8.jar
dom4j-1.1.jar swarm-1.4-rc1.jar
edtFTPj-2.0.4.jar velocity-1.6.1.jar
freemarker-2.3.15.jar velocity-tools-2.0-beta3.jar
hive-1.4-rc1.jar wasp-1.4-rc1.jar
ibatis-sqlmap-2.3.0.jar webservices-api.jar
inmethod-grid-1.4.2-SNAPSHOT.jar webservices-extra-api.jar
javassist-3.10.0.GA.jar webservices-extra.jar
jaxen-1.1.1.jar webservices-rt.jar
jconn2-1.jar wicket-1.4.7.jar
joda-time-1.6.jar wicket-datetime-1.4.7.jar
jta-1.1.jar wicket-extensions-1.4.7.jar
junit-3.8.1.jar wicket-ioc-1.4.7.jar
log4j-1.2.14.jar wicket-spring-1.4.7.jar
mail-1.4.jar wicket-spring-annot-1.3.5.jar
milyn-commons-1.5.jar wicomsec-1.4-rc1.jar
milyn-smooks-core-1.5.jar wiquery-1.0.1.jar
milyn-smooks-csv-1.5.jar xercesImpl-2.6.2.jar
milyn-smooks-flatfile-1.5.jar xmlpull-1.1.3.1.jar
milyn-smooks-javabean-1.5.jar xpp3_min-1.1.4c.jar
minis-1.4.1.jar xstream-1.4.1.jar
I am using Maven to manage my apps dependencies. My app does not depend
directly on some of these jars, like the struts jars. They got dragged
java.lang.IncompatibleClassChangeError: Class org.jaxen.JaxenHandler
does not implement the requested interface org.jaxen.saxpath.XPathHandler
at org.jaxen.saxpath.base.XPathReader.parse(XPathReader.java:98)
at
org.milyn.cdr.xpath.SelectorStepBuilder._buildSteps(SelectorStepBuilder.java:110)
at
org.milyn.cdr.xpath.SelectorStepBuilder.<clinit>(SelectorStepBuilder.java:43)
at
org.milyn.cdr.SmooksResourceConfiguration.setSelector(SmooksResourceConfiguration.java:447)
at
org.milyn.cdr.SmooksResourceConfiguration.<init>(SmooksResourceConfiguration.java:304)
at
org.milyn.cdr.SmooksResourceConfigurationStore.addHandlerFactoryConfig(SmooksResourceConfigurationStore.java:143)
at
org.milyn.cdr.SmooksResourceConfigurationStore.registerInstalledHandlerFactories(SmooksResourceConfigurationStore.java:139)
at
org.milyn.cdr.SmooksResourceConfigurationStore.<init>(SmooksResourceConfigurationStore.java:112)
at
org.milyn.container.standalone.StandaloneApplicationContext.<init>(StandaloneApplicationContext.java:59)
at org.milyn.Smooks.<init>(Smooks.java:118)
at org.milyn.Smooks.<init>(Smooks.java:170)
at
com.scanman.cron.task.ImportPriceChangesFromSupplier.executeTask(ImportPriceChangesFromSupplier.java:70)
at com.scanman.cron.task.ScanManTask.execute(ScanManTask.java:79)
at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
This is the first exception thrown before I started moving jars around
into the endorsed folder. The endorsed folder is empty when this
exception is thrown.
Thanks,
Warren Bell
Post by Christopher Schultz
Warren,
Post by Warren Bell
This makes me think I am on the right track and the exceptions I
am getting seem to point to the wrong classes being loaded.
Maybe, but maybe not.
Post by Warren Bell
My question is, is their a set of XML related jars that I should
take out of my app and place in this endorsed directory or is there
a different way of fixing this problem ?
What other JARs do you have in your webapp?
Also, what's the full stack trace of these exceptions? If you place
things into "endorsed" then they will plug-into JAXP which means that
Tomcat will use them internally to load things (like server.xml) and
so you'll need to have all dependencies (like xml-apis.jar for
instance) in that endorsed directory, too. Otherwise, you could get
weird stuff like this happening.
-chris
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Christopher Schultz
2011-12-16 23:13:25 UTC
Permalink
Warren,
Post by Warren Bell
First off, it had nothing to do with Tomcat or the JDK. It was a
conflict between two jars that Maven brought into my project with
Smooks and Velocity Tools.
Thanks for the report. Now, it's in the archives, not that anyone will
look. :(

- -chris

Konstantin Kolinko
2011-12-13 04:25:51 UTC
Permalink
Post by Warren Bell
Hello Tomcat Users,
I am having a problem with xerces and other jars in the JDK or Tomcat
conflicting with jars in my app. I am getting the following exception
when instantiating Smooks, a csv library that usese xerces, in a web app
What exact version of Tomcat x.y.z you are running and on what JDK?

(IIRC several bugs wrt XML parser handling were fixed during the last
year. Though it might not be related to your issue).

Do you run single webapp there, or several complex ones?

I think the libs should stay in app's WEB-INF/lib folder. Do not put
them in endorsed for now. (That will affect Tomcat as a whole).

As others noted, your libraries list is a mess.

One blatant thing is that you have both Spring 2.0.8 and 2.5.6 jars.
They are not supposed to coexist. Also note that there is "SEC03"
update of 2.5.6.

Best regards,
Konstantin Kolinko
Warren Bell
2011-12-13 05:19:02 UTC
Permalink
I was afraid I was going to get a reaction to my list like I did, it is
a mess. You get lazy and you just enter in a dependency and let Maven
drag everything in with it. As for the servlet jars, Tomcat just ignores
them and I never took the time to figure out where they were coming
from, that goes for the Struts jars too.

INFO [main] -
validateJarFile(/Library/apache-tomcat-6.0.16/webapps/scanman/WEB-INF/lib/servlet-api-2.3.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
INFO [main] -
validateJarFile(/Library/apache-tomcat-6.0.16/webapps/scanman/WEB-INF/lib/servlet-api-2.5.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class


How are you suppose to know what jars you really need when you let Maven
manage them ? I place just 2 dependencies in my pom.xml and 15 jars get
added to my project.

Thanks,

Warren Bell
Post by Konstantin Kolinko
Post by Warren Bell
Hello Tomcat Users,
I am having a problem with xerces and other jars in the JDK or Tomcat
conflicting with jars in my app. I am getting the following exception
when instantiating Smooks, a csv library that usese xerces, in a web app
What exact version of Tomcat x.y.z you are running and on what JDK?
(IIRC several bugs wrt XML parser handling were fixed during the last
year. Though it might not be related to your issue).
Do you run single webapp there, or several complex ones?
I think the libs should stay in app's WEB-INF/lib folder. Do not put
them in endorsed for now. (That will affect Tomcat as a whole).
As others noted, your libraries list is a mess.
One blatant thing is that you have both Spring 2.0.8 and 2.5.6 jars.
They are not supposed to coexist. Also note that there is "SEC03"
update of 2.5.6.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Warren Bell
2011-12-13 05:23:40 UTC
Permalink
Here the answers to your other questions.

Thanks,

Warren Bell
Post by Konstantin Kolinko
Post by Warren Bell
Hello Tomcat Users,
I am having a problem with xerces and other jars in the JDK or Tomcat
conflicting with jars in my app. I am getting the following exception
when instantiating Smooks, a csv library that usese xerces, in a web app
What exact version of Tomcat x.y.z you are running and on what JDK?
Tomcat 6.0.16 JDK 1.6
Post by Konstantin Kolinko
(IIRC several bugs wrt XML parser handling were fixed during the last
year. Though it might not be related to your issue).
Do you run single webapp there, or several complex ones?
Single
Post by Konstantin Kolinko
I think the libs should stay in app's WEB-INF/lib folder. Do not put
them in endorsed for now. (That will affect Tomcat as a whole).
As others noted, your libraries list is a mess.
One blatant thing is that you have both Spring 2.0.8 and 2.5.6 jars.
They are not supposed to coexist. Also note that there is "SEC03"
update of 2.5.6.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Caldarale, Charles R
2011-12-13 05:34:59 UTC
Permalink
Subject: Re: Tomcat xerces conflicts and Endorsed,Standards Override Mechanism
Tomcat 6.0.16
Might want to upgrade - that's getting close to four years old.
JDK 1.6
JDK 1.6.what?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Loading...