I solved many "shared class" problems by making sure that the "shared class"
is in the system classpath of the servlet runner rather than the "servlet
classpath" (ie \servlets directory). I think that its because the "system
classloader" remains constant whereas the "servlet classloader" changes when
a new version of the servlet class file is discovered and then loaded. I
believe that the servlet classloader has to change to get a new copy of a
given class loaded into the JVM. A given class in the JVM is identified by
the combination of the classloader's id and the classname itself.
John Zerbe - Mellon Bank
Phone: 412-234-1048 E-Mail:[EMAIL PROTECTED]
> -----Original Message-----
> From: Scheiderer, Stephan [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, July 15, 1999 3:13 AM
> To: [EMAIL PROTECTED]
> Subject: AW: Multiple servlets and a shared class
>
> I've got a similar problem using Apache and JServ.
> When I compile some classes "over" the old ones and call them on the
> server,
> the engine always starts a new thread.
> I assume that the engine opens some kind of new object environment,
> because
> even global object have to be allocated again.
> Is this an error...??
>
> > -----Urspr�ngliche Nachricht-----
> > Von: DeSarro Frank [SMTP:[EMAIL PROTECTED]]
> > Gesendet am: Mittwoch, 14. Juli 1999 18:36
> > An: [EMAIL PROTECTED]
> > Betreff: Multiple servlets and a shared class
> >
> > This is probably a foolish question, but I have spent so much
> time
> > trying to figure it out with little to show for it that I have to try
> > something. I'm new to servlets, but I've read Hunter's servlet book.
> > I'm working with Websphere Application Server. I have two servlets A &
> > B. There is a separate shared class, call it C that A & B use.
> > Everything works as I expect it to. The problem is that if I change
> > servlet B and place it on the server, when the newly loaded servlet B
> > tries to use class C it throws a ClassNot Found exception. Is my
> > thinking wrong? If C has not changed, I should not have to unload A
> > because of a change in B. The only way I can get it to work is to
> unload
> > A&B twice and then it works. This might be a dumb question, but I can't
> > seem to figure out what is happening. If my logic is sound, then I know
> > I have to focus on my code. If anyone can share any thoughts or even
> > point me to an article or book that would explain how this is supposed
> to
> > work I would appreciate it. Thanks.
> >
> >
> __________________________________________________________________________
> > _
> > 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
___________________________________________________________________________
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