You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marina <pp...@yahoo.com> on 2005/12/27 20:12:26 UTC

does Tomcat support optional packages?

Hi!

  I'm trying to use optional packages (JAR files) as
defined in the J2EE1.4 specification, and this does
not seem to work in Tomcat 5.5.12.

Basically, what it is , is that you declare some JARs
that you want to share between multiple WAR
applications by specifying an Extension-Name attribute
in the JAR's Manifest.MF files. Then, all Web apps
that have to reference those JARs can do so by
specifying an Extension-List attribute in their
Manifest.MF files and referencing the previously
defined optional libraries.

I used this mechanism in WebLogic Server - it worked
great. I tried to deploy the same WARs into Tomcat,
and place the optional packages in the
$TOMCAT/shared/lib (and I tried $TOMCAT/common/lib
too) directory - but this did not work - I was getting
errors from my Web apps complaining that specified
Extension names of the JARs were not found. 

If I place all shared JARs into the the
TOMCAT/shared/lib and remove all this Extension
mechanism from my Web apps - it works just fine.  But
the reason I wanted to use the same mechanism for
loading/referencing optional packages is that I did
not want to be dependent on a specific Web-container's
classloading mechanism, and be able to deploy my
applications un-modified in either WLS on Tomcat (or
other) container.

Does anybody know whether this optional package
support exists in Tomcat, or maybe I'm doing something
wrong ?

Thanks a lot!
Marina


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


Re: does Tomcat support optional packages?

Posted by Mark Thomas <ma...@apache.org>.
Just a quick correction to my previous post. Tomcat 5 will find
extensions in all the places (eg common/lib, shared/lib etc) it
normally looks for jars as well as the JDK/JRE locations.

Mark


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


Re: does Tomcat support optional packages?

Posted by Mark Thomas <ma...@apache.org>.
Marina wrote:
> Mark,
> Thanks for the clarification!
> 
> I still have the same problem with extension not found
> though. I checked in the code you pointed me to which
> attributes are required and added them to both shared
> JAR's MANIFEST.MF and to my Web app's MANIFEST.MF. I
> placed all shared jars into the $TOMCAT/shared/lib
> dir.

<snip>

> Am I missing something here?

Yep. The extensions are a JRE/JDK feature rather than a Tomcat
feature.
http://java.sun.com/j2se/1.3/docs/guide/extensions/extensions.html has
a good overview (I don't think much changed for 1.4 or 5.0). The
extensions are expected to be found in $JAVA_HOME/lib/ext in a JRE or
$JAVA_HOME/jre/lib/ext for an SDK.

Options are:
1. Use $TOMCAT/shared/lib and just remove all of the extension stuff
from the manifests
2. Placed your shared jars in the right directory in your JRE/JDK as
appropriate.

Mark


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


Re: does Tomcat support optional packages?

Posted by Marina <pp...@yahoo.com>.
Mark,
Thanks for the clarification!

I still have the same problem with extension not found
though. I checked in the code you pointed me to which
attributes are required and added them to both shared
JAR's MANIFEST.MF and to my Web app's MANIFEST.MF. I
placed all shared jars into the $TOMCAT/shared/lib
dir.
Here is an example of the MANIFEST.MF of a shared jar:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: yGuard Bytecode Obfuscator 1.0.1
Extension-Name: epcis-apiJAR
Specification-Version: 1.0
Implementation-Version: 2726
Implementation-Vendor-Id: com.connecterra

And here is how I reference it in the Web App's
MANIFEST.MF (an exerpt):

Manifest-Version: 1.0
Extension-List: edgeserverDependency
epcis-apiDependency jaxb-apiDependency
jaxb-implDependency jaxb-libsDependency
jaxb-xjcDependency relaxngDatatypeDependency
xsdlibDependency
edgeserverDependency-Extension-Name: edgeserverJAR
edgeserverDependency-Specification-Version: 2.0.0
edgeserverDependency-Implementation-Version: 2741
edgeserverDependency-Implementation-Vendor-Id:
com.connecterra
epcis-apiDependency-Extension-Name: epcis-apiJAR
epcis-apiDependency-Specification-Version: 1.0
epcis-apiDependency-Implementation-Version: 2726
epcis-apiDependency-Implementation-Vendor-Id:
com.connecterra
....

Yet, when I start TOmcat, I'm getting the following
error:
Dec 28, 2005 3:26:46 PM
org.apache.catalina.util.ExtensionValidator
validateManifestResources
INFO: ExtensionValidator[/rftagaware-2.0.0-tomcat][Web
Application Manifest]: Required extension
"epcis-apiJAR" not found.

Am I missing something here?

Thanks for your help!
MArina

--- Mark Thomas <ma...@apache.org> wrote:

> Marina wrote:
> 
> > Does anybody know whether this optional package
> > support exists in Tomcat, or maybe I'm doing
> something
> > wrong ?
> 
> It is there but the compatibility checking is too
> strict at the
> moment. See
>
http://issues.apache.org/bugzilla/show_bug.cgi?id=37854
> for more info. In summary it affects tc4 and tc5 and
> tomcat requires
> all optional attributes to be present in all
> relevant manifests.
> 
> For more detail, take a look at the relevant source
> at
>
http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/Extension.java
> and search for isCompatibleWith
> 
> The tc4 code is the same.
> 
> Mark
> 
> 
>
---------------------------------------------------------------------
> 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: does Tomcat support optional packages?

Posted by Mark Thomas <ma...@apache.org>.
Marina wrote:

> Does anybody know whether this optional package
> support exists in Tomcat, or maybe I'm doing something
> wrong ?

It is there but the compatibility checking is too strict at the
moment. See http://issues.apache.org/bugzilla/show_bug.cgi?id=37854
for more info. In summary it affects tc4 and tc5 and tomcat requires
all optional attributes to be present in all relevant manifests.

For more detail, take a look at the relevant source at
http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/Extension.java
and search for isCompatibleWith

The tc4 code is the same.

Mark


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