Hi, sorry for jumping in, but:

> Or rather, the
> spec requires the platform to be implemented to use a different
> classloader for each application, to make it appear to the program
> that it's living in its very own JVM, and hence each application would
> have its own singleton.  Check the 2.2 servlet spec and read up on
> "web applications".

Actually, the JVM spec (1.2.2 & 1.3) forbids having two different copies of
the
same class under the same JVM, even if the copies were loaded using
different class loaders
(section 5.3.4, "Loading Constraints").
Hence, the term "appear to the program that it's living in its very own JVM"
is not
very correct. In fact, it imposes a problem. Consider the following
scenario:

I have two web applications inside a JVM. Each application has its own
classpath.
I have a JAR file that both should use. I copy it once to each application -
now I have
two copies of the JAR file, one inside each application's classpath.

I want to replace a class that is found inside the JAR file, so the changes
will imply
only in application A. So, I go to A's claspath's JAR file and replace it.
Then - boom!
I have two different copies of the same class under the same JVM, then my
application server
throws me exceptions and I have to restart the whole thing.


        - Isaac

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to