> 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.
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
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]