tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: [Fwd: static fields suddenly started sharing]
Date Mon, 07 May 2007 15:28:04 GMT
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.
> Up until last week the static fields in one application never saw the 
> static fields in the other but I changed something and suddenly they do.
> All the advice I've found through searching the web suggests this 
> cannot happen because the two apps use different class loaders. But it 
> definitely is happening.
> I'm getting it on Tomcat 4.1 and 5.5 (my two live platforms).
>
> 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.
>
> Can anyone suggest where I should be looking? I'm wondering if I am 
> managing to call something I shouldn't too early in the application 
> initialisation. 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,
you sure you haven't added WEB-INF/lib to a classpath in a startup 
script or done something else funky like that.

what you could do, is to create a little script that does

ClassLoader parent = this.getClass().getClassLoader();
while ( parent != null ) {
  if (parent instance of URLClassLoader) {
    //print URLs using getURLS() method
  }
  parent = parent.getParent();
}

Filip
>
> Thanks for any help
> Roger
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


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


Mime
View raw message