Thanks.
This is a PHP web, PHP files being interpreted by a Servlet provided by
PHP-Java-Bridge.
PHP files instantiate a new Java class of mine, which in turn calls a
static Java class of mine which returns the properties.
My Java classes are within the webs only (that is under
$CATALINA_HOME/webapps/webappX/WEB-INF/classes).
Reich, Matthias wrote:
ResourceBundle.getBundle uses the ClassLoader that was used to load the
class that's calling this method when it looks up the resource.
Have you checked that the class which contains the call to
ResourceBundle.getBundle
is loaded by the expected WebappClassLoaders?
Matthias
-----Original Message-----
From: Robert Soeding [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 23, 2007 2:37 PM
To: users@tomcat.apache.org
Subject: WebApps not isolated
Hi, since this is my first posting in this mailing list, I
would like to
thank you very much for providing and maintaining Tomcat.
I'm using Tomcat 5.5.20 and .23, Sun Java 1.5.x, on Ubuntu 7.04.
I've deployed two identical WebApps, webapp1 and webapp2, by letting
Tomcat unpack two WAR files. Next I changed
$CATALINA_HOME/webapps/webappX/WEB-INF/classes/myProps.properties in
both webapps to point to different databases. Next, I
restarted Tomcat.
The code to access properties is simply,
ResourceBundle.getBundle("myProps").getString(key);
The problem is, both webapp1 and webapp2 access the same
myProps.properties (webapp2 access webapp1's
myProps.properties). When I
undeploy webapp1, webapp2 will use its own properties file again.
As an additional test, I downloaded a fresh copy of Tomcat, deployed
both webapps, edited myProps.properties, and ran this fresh
instance. In
this instance, webapp1 would use the properties file of
webapp2 (while
in the other instance of Tomcat, webapp2 would access webapp1's
properties file).
Anyways, both webapps are not isolated properly.
On another server I was not able to reproduce this behavior,
using the
same WAR files.
I've also looked for JARs that might contain the properties
file in the
$CLASSPATH, $CATALINA_HOME/common/* and
$CATALINA_HOME/webapps/webapp1/WEB-INF/lib, but such a JAR does not
exist. Moreover, different properties files are used, probably,
depending on which webapp is loaded first.
Any ideas?
Thanks
Robert
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]