At 08:32 PM 4/10/02 -0700, you wrote:
>At 09:58 PM 4/10/02 -0400, you wrote:
>>Try RMI.  ...
>that sounds like a good way to solve the problem with different nodes.
>
>>Sharing across different contexts within the same Tomcat engine is a 
>>different matter. ...
>it looks like a different class loader is used  ...

according to jason hunter, each web app (context) has its classes loaded by 
a different class loader. he claims that if i put the class to be shared in 
the server_root/classes, then it wll be found. this does not seem to work 
under tomcat 4.0.1 as he tries to load other contexts first and throws a " 
... ----- Root Cause ----- java.lang.NoClassDefFoundError: 
Singleton       at .<clinit>(S.java:28) ".

now the server_root context is first in the the server.xml file, but it is 
commented out as follows:

         <!-- Tomcat Root Context -->
         <!--
           <Context path="" docBase="ROOT" debug="0"/>
         -->
so that's maybe why he can not find the class.

however, uncommenting this throws the same result (but it waits until you 
try to load on of the servlets that wants the singleton.

how is this supposed to work?

thanks


>>Ray Tayek wrote:
>>
>>>hi, i need to have a global singleton that is a singleton across all 
>>>instances of (tomcat) servlet engines.
>>>is there an engine context in tomcat that i can access?
>>>does this singleton work across virtual hosts?
>>>how does this work across multple jvm's on the same machine (or does 
>>>this not happen)?
>>>how about when you are load balancing across different physical nodes? - 
>>>do you need to have some system semaphore on one of the nodes to prevent 
>>>multiple instances?
>>>afaict so far, restarting a context, takes down all of the classes in 
>>>the context and putting copy of singleton into a different context, 
>>>seems to cause two instances to be created.
>>>any pointers would be appreciated. ...
>>...
>
>---
>ray tayek http://home.attbi.com/~rtayek/
>actively seeking telecommuting work
>vice chair orange county java users group http://www.ocjug.org/ 
>mailto:[EMAIL PROTECTED]
>hate spam? http://samspade.org/ssw/
>
>
>--
>To unsubscribe:   <mailto:[EMAIL PROTECTED]>
>For additional commands: <mailto:[EMAIL PROTECTED]>
>Troubles with the list: <mailto:[EMAIL PROTECTED]>

---
ray tayek http://home.attbi.com/~rtayek/
actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:[EMAIL PROTECTED]
hate spam? http://samspade.org/ssw/


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to