You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Fran Fabrizio <ff...@mmrd.com> on 2000/09/27 19:09:40 UTC
Tomcat class loader suddenly unstable
Hello all,
I hope this is the appropriate place to ask a technical Tomcat question,
if not, any pointers will be appreciated.
Our tomcat development environment has suddenly become quite unstable.
It's changing quite fast, so I can't pinpoint exactly what we were doing
when it started to be unstable, but here are the symptoms:
We are using the session capabilities to maintain state across a series
of JSP and servlet-generated pages. In the session, we are storing
objects named Patient and Login. These not-very-well-designed objects
just contain some publicly accessible data fields. login.user,
login.password, etc... A user first visits the login.jsp, where they
fill in a name and password. That name and passwor dgets placed into a
Login object which gets stored in the session and passed to the other
JSPs and servlets to validate the request.
A seperate development effort is occuring on the same tomcat server and
in the same context. This is a group of us developing a set of classes
to help the JSPs connect to various data sources. One of them
(MySQL_Server_Connector) is designed to connect to MySQL.
Seperately, the two pieces work fine. The problem occurs when I make a
change to MySQL_Server_Connector, compile it, and drop it into the
classes directory of the tomcat context. When I do that, the folks
working on the JSP pages start getting ClassCastException: relating to
the Login class. In other words, the servlet that was previously
correctly retrieving the Login object from the session suddenly stopped
being able to do so when I dropped a completely unrelated .class file
into the classes directory.
It seems to me that somehow the Tomcat classloader is doing something
when it notices that there's a new MySQL_Server_Connector.class out
there and tries to load it in. For some reason, when it does that, all
the sessions seem to get blown away. Nothing short of a Tomcat restart
will get the JSPs to work. Even if the user navigates back to the
login.jsp, it won't do a valid login until I restart Tomcat.
Also, occasionally I'm seeing "RELOAD!!" messages on the console where
I started Tomcat. These seem to often happen in conjunction with me
dropping in a new .class file. What are these?
Also, once or twice this morning the server just stopped responding.
I've seen all manner of errors like Resource already committed, or
IOException, in addition to the ClassCastException. I'm at a loss now,
and I was hoping someone would be able to shed some light on the
subject.
Thanks very much for your time!
-Fran
Re: Tomcat class loader suddenly unstable
Posted by Fran Fabrizio <ff...@mmrd.com>.
Sorry about the omission. = ) Tomcat 3.1
I have a new theory as to the cause, too. MySQL_Server_Connector extends
Server_Connector. If I compile MySQL_Server_Connector and drop it into the
classes directory, maybe it's having trouble finding it's dependencies or
something? Maybe the class loader that loads MySQL_Server_Connector can't
find the other classes or something goofy like that?
Can someone briefly explain (or point me to an explanation of) the class
loader mechanism and how it works?
Thanks,
Fran
> What version of tomcat :-) ?
>
> Costin
Re: Tomcat class loader suddenly unstable
Posted by cm...@yahoo.com.
What version of tomcat :-) ?
Costin
On Wed, 27 Sep 2000, Fran Fabrizio wrote:
> Hello all,
>
> I hope this is the appropriate place to ask a technical Tomcat question,
> if not, any pointers will be appreciated.
>
> Our tomcat development environment has suddenly become quite unstable.
> It's changing quite fast, so I can't pinpoint exactly what we were doing
> when it started to be unstable, but here are the symptoms:
>
> We are using the session capabilities to maintain state across a series
> of JSP and servlet-generated pages. In the session, we are storing
> objects named Patient and Login. These not-very-well-designed objects
> just contain some publicly accessible data fields. login.user,
> login.password, etc... A user first visits the login.jsp, where they
> fill in a name and password. That name and passwor dgets placed into a
> Login object which gets stored in the session and passed to the other
> JSPs and servlets to validate the request.
>
> A seperate development effort is occuring on the same tomcat server and
> in the same context. This is a group of us developing a set of classes
> to help the JSPs connect to various data sources. One of them
> (MySQL_Server_Connector) is designed to connect to MySQL.
>
> Seperately, the two pieces work fine. The problem occurs when I make a
> change to MySQL_Server_Connector, compile it, and drop it into the
> classes directory of the tomcat context. When I do that, the folks
> working on the JSP pages start getting ClassCastException: relating to
> the Login class. In other words, the servlet that was previously
> correctly retrieving the Login object from the session suddenly stopped
> being able to do so when I dropped a completely unrelated .class file
> into the classes directory.
>
> It seems to me that somehow the Tomcat classloader is doing something
> when it notices that there's a new MySQL_Server_Connector.class out
> there and tries to load it in. For some reason, when it does that, all
> the sessions seem to get blown away. Nothing short of a Tomcat restart
> will get the JSPs to work. Even if the user navigates back to the
> login.jsp, it won't do a valid login until I restart Tomcat.
>
> Also, occasionally I'm seeing "RELOAD!!" messages on the console where
> I started Tomcat. These seem to often happen in conjunction with me
> dropping in a new .class file. What are these?
>
> Also, once or twice this morning the server just stopped responding.
> I've seen all manner of errors like Resource already committed, or
> IOException, in addition to the ClassCastException. I'm at a loss now,
> and I was hoping someone would be able to shed some light on the
> subject.
>
> Thanks very much for your time!
>
> -Fran
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>