-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roger,

Roger Parkinson wrote:
> I have two different applications and they both make use of a common
> jar library. The common library has several static fields.

[snip]

> I am trying to figure out what I changed to make this happen because
> it is causing me problems. The changes I made were a restructure,
> shifting things around into different folders in my eclipse project,
> but the same jar files are in WEB-INF/lib as there always were.

That's odd. If you really have those JAR files in WEB-INF/lib, then they
/should/ be in different ClassLoaders and therefore has their own
webapp-private static fields.

It is possible that you also added the library in question to the
server/lib directory at some point?

> Can anyone suggest where I should be looking?

I'm sure you have already read the Tomcat Class Loader HOW-TO
(http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html), but
I'll mention it just in case.

* WEB-INF/lib should be private to the app
* TOMCAT_HOME/shared/lib should truly be shared (unified static)
* TOMCAT_HOME/common/lib should truly be shared (unified static)
  but Tomcat itself can access the library, too

> I'm wondering if I am managing to call something I shouldn't too
> early in the application initialisation.

Probably not. If you want a wall between the apps, then
order-of-initialization shouldn't be a problem. Your webapps should be
entirely separate.

> Each of the apps has a context listener that does some stuff on
> startup of the app (including initialising some statics), but they
> haven't changed since it was working. I still have the older 
> structure and it still works, and I can't see any relevant changes,

Are you moving from TC 4.1 to TC 5.5? I believe that the class-loading
rules didn't change from 4.1->5.0->5.5, but it's possible that there's
some kind of bug in 4.1 that was preserved for some reason while 5.0 and
5.5 work "properly".

Someone else on the list will have to comment on that.

You should look for all relevant copies of that JAR file to determine
what's happening. Let us know where you can find copies (if you can)
outside of the WEB-INF/lib directories of your various webapps.

Just out of curiosity, which library are we talking about?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGP2GX9CaO5/Lv0PARArB9AKCGHIgiyaqDcoEclgbtI+d8RY4JywCbBB6J
Gq+XPloztCr73l9MBC8Hzh8=
=mmDV
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to