Maven 1

cactus plugin does not work with tomcat

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: 1.0-rc2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

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.

Activity

Hide
Vincent Massol added a comment -

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?

Show
Vincent Massol added a comment - 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?
Hide
Norbert Pabis added a comment -

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.

Show
Norbert Pabis added a comment - 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.
Hide
Vincent Massol added a comment -

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?

Show
Vincent Massol added a comment - 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?
Hide
Norbert Pabis added a comment -

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.

Show
Norbert Pabis added a comment - 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.
Hide
Vincent Massol added a comment -

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

Show
Vincent Massol added a comment - 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
Hide
Norbert Pabis added a comment -

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

Show
Norbert Pabis added a comment - Ok, I'll file bugs related to MAVEN-884 and MAVEN-885 in Cactus Bugzilla .
Hide
Vincent Massol added a comment -

Thanks!

Show
Vincent Massol added a comment - Thanks!
Hide
Vincent Massol added a comment -

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

Show
Vincent Massol added a comment - A bug entry has been created in Cactus' bugzilla to help user debug problems.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: