----- Original Message -----
From: "Matthias Carlsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>

> Obviously, this must be some problem with the classloader.

This is correct. On reloading a servlet, all the classes are reloaded in a
new classloader. So when you try to use the attributes (instrance of your
own classes which are not on the classpath), you will get a
ClassCastException.


> I haven't found
> any
> workaround for this in my code (if there is any).

You can not do anywork around for this in your code. The servlet container
has to do it for you.


>
> My current solution is to use Resin as my development server (which
doesn't
> have this problem) and when the code is finished, I move them to the
Tomcat
> server.

I think tomcat has a option (TC 4.0 I think has it, not sure if 3.x has it
or not) that on reloading it can serialize the sesssion attributes to disk
and then read them back. This will avoid the ClassCastException, but this
imposes the added requirement that anything that you place in the session
should be serializable.

I think that is the way resin should be handling it, but I have not have had
a look at Resins code.


Regds,
Gokul


>
> [ Matthias Carlsson ]
> [ Programmer (Java, XML/XSL, CGI/Perl, HTML/JS) ] [ Web Designer ]
> [ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]

___________________________________________________________________________
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

Reply via email to