Issue Details (XML | Word | Printable)

Key: MAVEN-884
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Vincent Massol
Reporter: Norbert Pabis
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 1

cactus plugin does not work with tomcat

Created: 03/Oct/03 04:45 AM   Updated: 08/Mar/06 10:47 PM   Resolved: 09/Oct/03 05:20 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0-rc2

Time Tracking:
Not Specified


 Description  « Hide

Tomcat comes with commons-loggin-api.jar in TOMCAT_HOME/common/lib
This raises classloader or maybe version issues when using cactus plugin which has its own commons-logging jar.

It causes errors in initialization of servlets.



Vincent Massol added a comment - 03/Oct/03 04:59 AM

I have been testing the cactus plugging with several different versions of Tomcat and I've never had a problem. However, I've noticed in your previous message on the maven user mailing list that somehow version 1.0 of commons-logging gets int your xlsdb-cactus war. However, the cactus plugin references version 1.0.3 of commons-logging. What version of the Cactus plugin are you using?


Norbert Pabis added a comment - 03/Oct/03 05:27 AM

I am using Maven from HEAD with cactus plugin version 3.1
and Tomcat 4.1.27-LE

commons-logging does not get into my -cactus war.
I think that commons-logging-api.jar from Tomcat/common is loaded into
common applicatin classloader and then comes jar from cactus-plugin dependency and this somehow results in trouble.
When I removed TOMCAT_HOME/common/commons-logging-api.jar the problem disappeared.


Vincent Massol added a comment - 03/Oct/03 05:41 AM

Here is the file you sent to the list:

"
2003-10-02 23:43:48 HostConfig[localhost]: Expanding web application archive xlsdb-cactus.war
2003-10-02 23:43:49 StandardHost[localhost]: Installing web application at context path /xlsdb-cactus from URL file:/tmp/cactus/tomcat4x/webapps/xlsdb-cactus
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploying class repositories to work directory /tmp/cactus/tomcat4x/work/Standalone/localhost/xlsdb-cactus
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy class files /WEB-INF/classes to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/classes
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/aspectjrt-1.0.6.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/aspectjrt-1.0.6.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/cactus-13-1.6dev-20030809.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/cactus-13-1.6dev-20030809.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/commons-httpclient-2.0-rc1.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/commons-httpclient-2.0-rc1.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/commons-logging-1.0.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/commons-logging-1.0.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/csvjdbc-0.9.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/csvjdbc-0.9.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/httpunit-1.5.3.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/httpunit-1.5.3.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/junit-3.8.1.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/junit-3.8.1.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/poi-1.8.0-dev-20020919.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/poi-1.8.0-dev-20020919.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/velocity-1.3.1.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/velocity-1.3.1.jar
2003-10-02 23:43:50 WebappLoader[/xlsdb-cactus]: Deploy JAR /WEB-INF/lib/velocity-dep-1.3.1.jar to /tmp/cactus/tomcat4x/webapps/xlsdb-cactus/WEB-INF/lib/velocity-dep-1.3.1.jar
2003-10-02 23:43:51 ContextConfig[/xlsdb-cactus]: Configured an authenticator for method BASIC
2003-10-02 23:43:51 StandardManager[/xlsdb-cactus]: Seeding random number generator class java.security.SecureRandom
2003-10-02 23:43:51 StandardManager[/xlsdb-cactus]: Seeding of random number generator has been completed
2003-10-02 23:43:52 StandardContext[/xlsdb-cactus]: Exception starting filter filterredirector
java.lang.ExceptionInInitializerError
[...]
"

As you can see commons-logging 1.0 is included. This is what I find strange and I don't understand how it is possible as the Cactus plugin for Maven includes version 1.0.3...

Any idea?


Norbert Pabis added a comment - 03/Oct/03 06:03 AM

You gave me right clue.
The answer is easy: in my project.xml I have dependency to commons-logging-1.0

So there are 3 cases:
1. There is commons-loggging in tomcat/common/lib
which is probably 1.0.3),I have commons-loggging-1.0 dependency,
and cactus-plugin depends on commons-loggging-1.0.3
In this case my project.xml overrides plugin dependencies and commons-loggging-1.0 goes to app-cactus.war
Result: errors

2. There is NO commons-loggging in tomcat/common/lib
which is probably 1.0.3),I have commons-loggging-1.0 dependency,
and cactus-plugin depends on commons-loggging-1.0.3
In this case my project.xml overrides plugin dependencies and commons-loggging-1.0 goes to app-cactus.war
Results: ok

3. There is commons-loggging in tomcat/common/lib
which is probably 1.0.3),I have commons-loggging-1.0.3 dependency,
and cactus-plugin depends on commons-loggging-1.0.3
In this case commons-loggging-1.0.3 goes to app-cactus.war
Result: ok

I don't know what should be considered as correct.
Cactus-plugin should probably force its 1.0.3 version.


Vincent Massol added a comment - 03/Oct/03 06:09 AM

I think the best behaviour would be that Cactus issues a warning if one of the cactus-related jar files it requires is already in the original war to cactify.

Do you think you could help me by entering this as a bug in Cactus'bugzilla, so that we don't forget to fix it?

Thanks
-Vincent


Norbert Pabis added a comment - 03/Oct/03 06:21 AM

Ok, I'll file bugs related to MAVEN-884 and MAVEN-885 in Cactus Bugzilla .


Vincent Massol added a comment - 03/Oct/03 06:27 AM

Thanks!



Vincent Massol added a comment - 09/Oct/03 05:20 AM

A bug entry has been created in Cactus' bugzilla to help user debug problems.