You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ronald Klop <ro...@base.nl> on 2009/01/19 15:55:30 UTC
java6, jaf and multiple contexts in tomcat 5.5.27
Hi,
I'm running a webapp which use jaf (java activation framework) for javamail. In the past it was possible to deploy different versions of our webapp in different contexts of one tomcat instance. Jaf always was a jar within our context. Since java 6 jaf is included in java 6 and we removed it from our webapp. But since it is part of java 6 it is also loaded by the system classloader (I think).
When we now load multiple contexts with different versions of our webapp. The contexts share some jaf internal map's about mimetype mappings. This conflicts, because newer version of our webapp have more mimetype mappings than the older ones, but the older ones do find the mappings now.
Do other people see this? And do you have a workaround? Googling gave me 1 person with the same problem, but not with Tomcat, so he had a workaround which didn't apply for my situation.
Is there anything else I can do than run multiple instances of Tomcat?
Does it give problems to put the jar of jaf back in my webapp? I don't like it to have double classes in the classpath.
Ronald.
<offtopic>PS: How can I stop Sun from adding so much (JAF, JAXB, etc.) in the JVM? This makes my application a lot less flexible for deployment.</offtopic>
RE: java6, jaf and multiple contexts in tomcat 5.5.27
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ronald Klop [mailto:ronald-mailinglist@base.nl]
> Subject: java6, jaf and multiple contexts in tomcat 5.5.27
>
> But since it is part of java 6 it is also loaded by the
> system classloader (I think).
Not also, it's loaded only by the system classloader.
> When we now load multiple contexts with different versions of
> our webapp. The contexts share some jaf internal map's about
> mimetype mappings. This conflicts, because newer version of
> our webapp have more mimetype mappings than the older ones,
> but the older ones do find the mappings now.
You'll have to provide more details about your usage of the mime types. What specific classes are you using? (Presumably, MimetypesFileTypeMap is involved, but you'll need to verify that.) How are you creating them? Where do store these objects such that they're visible to multiple webapps?
If you're using META-INF/mimetype.default in your webapps, the first one in wins. That file is saved in a static field in MimetypesFileTypeMap, so you can only have one. Best not to use it in an app server environment.
A similar issue exists with {set|get}DefaultFileTypeMap(), since there can be only one default per JVM now; you'll have to avoid using that as well.
> I don't like it to have double classes in the classpath.
That's good, because doing so guarantees confusion, at best.
> <offtopic>PS: How can I stop Sun from adding so much (JAF,
> JAXB, etc.) in the JVM? This makes my application a lot less
> flexible for deployment.</offtopic>
Unfortunately, you can't. You're stuck with distributing different versions of your webapp (or at least different installation instructions) based on the JVM being used. A really clever deployment script could automate the process.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org