-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
> I have four zones configured. When I launch a servlet in one zone, I can use
> that program all I want until I open a program from another zone. At that
> point, the session from the first zone gets overwritten or expired or
> something. Now, this doesn't happen when cookies are disabled. Could it be a
> problem with overwriting a cookie value? It is also not a problem when
> accessing from different machines...only when accessing servlets in
> different zones from the same browser.
If this helps any, Sessions are not valid across zones. Here is an email
that I sent to the servlets list the other day regarding the creation of a
singleton that could be shared across zones. Essentially the same thing
applies to Sessions in a zone. For what it is worth, I have been working on
a new classloader system for Apache JServ for two+ weeks now. It is coming
along nicely and will handle classreloading a lot better, but still does not
solve your problem. The hard truth is that sessions just are not valid
across zones...period.
the question was:
> Unfortunatly JServ obviously initializes one filecache now per
> Servlet-Zone !?
>
> in fact I see as many "I have been initialized !" as
> servlet-zones are defined.... hmmmm....
>
> how to overcome this ?! i just want to have one filecache created per
> VM.
my answer is:
Wow, I know this answer because I have been futzing with the ClassLoader
stuff all week now.
The problem (for you) is that when classes are loaded, they are class loader
dependent. This means that each instance of each class that is created has a
class loader associated with that class (see: Class.getClassLoader()).
So, since each zone has an instance of AdaptiveClassLoader associated with
it, that means that you will get one new filecache per zone, regardless of
the singleton properties. Note that you are correctly only getting on
instance per zone.
Another way to think of this is that you can consider different zones
running in different JVM's on different machines. There would be no way to
have one instance of a singleton in this case because the JVM's could be on
totally different machines!
The only way that I can think of getting around this (and it probably won't
work, but try it anyways) would be to put that class into the system
classloader path. In other words, put it into the wrapper.classpath= instead
of the repositories= classpath. This means that the filecache will not be
reloaded when your servlets are reloaded, but it should allow you to only
create one instance of it.
Your only other option would be to write some sort of daemon that ran in a
JVM all by itself and loaded that singleton into memory and served requests
for it. You could use something like XML-RPC <http://www.xml-rpc.com/> or
RMI or EJB to handle this.
I hope that makes sense.
-jon
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]