A workaround for it is to run your singletons as RMI services, and have each of your servlets get a reference to it with a java.rmi.Naming.rebind() in the init() method.  Might seem a bit like overkill now, but it means it'll scale nicely to multiple machines later.

A quick run through the HelloWorld RMI program in the JDK docs will get you going on this quite quickly.

Regards,
David

Michael Prescott wrote:

Hmm.. are the singleton class files in the reloadable class path, or does
iPlanet have such a concept?  We ran into problems with JRun in the early
stages of development when we had non-servlet singleton files in the
reloadable classpath.

If this is true with iPlanet in general, it sounds like a big problem.
Certain system-type services (like custom logging, connection pooling, etc.)
are easy to implement as singletons, especially since there's no way I know
of to load code into the app server's JVM except via servlet initialization.

Michael

----- Original Message -----
From: James Dunn <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 02, 2000 12:00 AM
Subject: Weird iPlanet Problem

> Hello everybody,
>
> Here is my weird iPlanet problem.  It seems like iPlanet's servlet
> engine creates a new instance of its class loader for each servlet that
> runs.  This causes me problems because I use several "singleton" classes
> in my code.  Because each servlet starts with its own separate class
> loader, each servlet gets its own separate instance of a singleton
> class, which causes me pain.
>
> In contrast JRun seems to only use a single class loader per jrun
> instance which means my singleton classes operate as designed.
>
> Has anyone else ever seen this problem before, or know a
> solution/workaround for it?
>
> Thanks,
>
> Jim
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

-- 
David Bullock
Project Leader 
[EMAIL PROTECTED]

"It's no use saying 'We are doing our best.'  You 
have got to succeed in doing what's necessary."  
    ...Winston Churchill


LISAcorp
http://www.lisa.com.au/

Adelaide                  Sydney
--------------------      ------------------------
38 Greenhill Rd           Level 3, 228 Pitt Street
Wayville S.A. 5034        Sydney NSW 2000

PH  +61 8 8272 1555       PH  +61 2 9283 0877
FAX +61 8 8271 1199       FAX +61 2 9283 0866
--------------------      ------------------------
 

Reply via email to