We are running
several J2EE Applications on one single application server (Orionserver). Each
application needs its own AXIS service. This was no problem to configure but we
have realized that AXIS doesn't respect the different classloaders used by each
J2EE application. For jws files it uses it's own classloader. That is
ok, but it also uses the classloader tree from the first
referenced application on all applications (!) thereby breaking the rule
that J2EE applications should be separated. This is causing us severe problems
as we are relying on each J2EE application having its separate classloader tree
(separate instances of static variables for the same type of class for example).
Comments?
Here is an example of the problem:
Consider the following class which is also exported as a
webservice:
public class Foo {
public static String test;
public String getTest() {
return test;
}
}
This class has a static variable named "test". The class
exists in three application "A", "B" and "C" (the applications share a
common class path). So there are three instances of the static variable - one
for each application. The classloader hierachy in a J2EE server makes sure that
the three instances are kept separate for each J2EE application. The value of
test is set to "a", "b" and "c" respectively in each J2EE application (occurs
during startup of the application in the EJB
layer).
Calling the getTest method from any J2EE application will work all right (deliver the correct letter / instance of test), but subsequent calls to the other applications will return the same letter / instance of test as the first call. I find this being a serious bug breaking the isolation between applications. One can argue if using static variables is orthodox, but I see no reason why to break the native classloader hierarchy
Regards
/David Ekholm,
System architect, Net Entertainment AB
Sidenote: We are using the latest version of AXIS and
Orionserver as J2EE platform, essencially the same platform as Oracle
9i.
