Thank you for submitting this one. You are quite right, the MANIFEST.MF is not correct. Not only does it have formatting problems, but junit should not be a runtime dependency. This jar was generated with Maven so I am guessing the formatting problem is a Maven bug. I'll remove the junit dependency and rebuild the distribution this evening.
Mike
Ias wrote:
The current 2.0 beta 1 distribution doesn't work with Tomcat 4.x. The error message is Catalina.start: LifecycleException: Missing optional package Extension[junit, implementationURL=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.ja r, implementationVersion=3.8.1] LifecycleException: Missing optional package Extension[junit, implementationURL=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.ja r, implementationVersion=3.8.1] at org.apache.catalina.loader.WebappLoader.validatePackages(WebappLoader.ja va:1244) at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:645) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1100) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3345 ) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.start(StandardHost.java:614) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
I looked into the stack trace and found that there needed to be some modification toward the associated jars-commons-httpclient-2.0-beta1.jar, junit-3.8.1.jar, and commons-logging-1.0.jar.
First, Tomcat's org.apache.catalina.loader.Extension.getRequired
distinguishes required libraries by delimiter not "," but " ".
Therefore,
Extension-List: junit,commons-logging
should be
Extension-List: junit commons-logging
in MANIFEST.MF of httpclient jar. (http://java.sun.com/j2se/1.4.1/docs/guide/extensions/versioning.html proves the usage.)
Next, since Tomcat's resolving algorithm for required libraries is quite strict as implemented in o.a.c.l.WebappLoader.validatePackages(), Specification-Version and Implementation-Vendor-Id of the extensions should be defined like this:
junit-Extension-Name: junit
junit-Specification-Version: 3.8.1
junit-Implementation-Vendor-Id: junit-Implementation-Version: 3.8.1
junit-Implementation-URL:
http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar
commons-logging-Extension-Name: org.apache.commons.logging
commons-logging-Specification-Version: 1.0
commons-logging-Implementation-Vendor-Id: commons-logging-Implementation-Version: 1.0.2
commons-logging-Implementation-URL:
http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.2.
jar
In accordance with the above addition, MANIFEST of junit and commons-logging also should be updated to comply with commons-httpclient.
Manifest-Version: 1.0
Created-By: Ant 1.4.1
Extension-Name: junit
Specification-Version: 3.8.1
Implementation-Vendor-Id: Implementation-Version: 3.8.1
Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1beta1
Extension-Name: org.apache.commons.logging
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.0
Implementation-Vendor: Apache Software Foundation
Implementation-Vendor-Id: Implementation-Version: 1.0.2
Class-Path: log4j.jar log4j-core.jar
Otherwise, you can figure out this conflict by simply removing Extension-List and its followings. The attached files are completely updated MANIFESTs. Again, I'd like to remind you that this issue is now only proved to be relevant with Tomcat and hence am not sure it can cause a problem under other platforms. (I saw my colleague using http-client 2.0 beta 1 on his dos prompt without trouble even though his classpath didn't include junit.jar.)
Thanks for this great work, http-client 2.0,
Ias.
=========================================================== Lee, Changshin (Korean name) Ias (International name) Company Web Site: http://www.tmax.co.kr Personal Web Site: http://www.iasandcb.pe.kr ---------------------------------------------------------
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
