You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Warren Bell <wa...@gmail.com> on 2011/12/16 18:32:25 UTC

Re: RESOLVED Tomcat xerces conflicts and Endorsed,Standards Override Mechanism

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

On 12/12/11 10:27 PM, Pid * wrote:
> On 13 Dec 2011, at 03:27, Warren Bell <wa...@gmail.com> wrote:
> 
>> 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
> 
> So I'd guess that anything with an X in its name would go in endorsed,
> then I'd refine from there.
> 
> 
>>
>> 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
> 
> 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
> 
>> 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
>>
>> On 12/12/11 11:49 AM, Christopher Schultz wrote:
>>> Warren,
>>>
>>> On 12/9/11 4:47 PM, Warren Bell wrote:
>>>> 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.
>>>
>>>> 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-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: RESOLVED Tomcat xerces conflicts and Endorsed,Standards Override Mechanism

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Warren,

On 12/16/11 12:32 PM, Warren Bell wrote:
> 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7r0JUACgkQ9CaO5/Lv0PCjIwCdE8uvXiY2ekji5oYjW3XyuqOg
iosAn0Ym9ton8ahHuHZVxZssOsNqSWfS
=2Gua
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org