OK after several days of head banging on this problem, I found the problem
thanks to the tips from you guys.

I was putting CHyperlink objects into a vector which was in a session and
than using another servlet to get the CHyperlink objects out of the vector.
However i was getting run time errors when i tried to cast the Objects back
to CHyperlinks.

What I discovered was that when I restarted tomcat everything was working,
and then i made changes in my servlets and hit Rebuild all in JBuilder.
Then i got the error again when trying to cast.

What i think happened was because I hit rebuild all a new version of
CHyperlink was being generated and then when attempting to cast the object
that was still sitting in the Vector it failed because the JVM must have
checked the signature on the object in the Vector vs the CHyperlink class i
just rebuilt.

As long as i restart the server after making changes to the classes
everything is working fine.

Does this result make sense to you all?

Thanks again,
Ivan

----- Original Message -----
From: "Filip Hanik" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, April 28, 2001 2:28 PM
Subject: RE: Objects in Vector are loosing type


> > So are you saying it is by chance if a different class loader loads each
> > servlet and this can effect the casting?
>
> yes, the same class loaded by different class loaders, is not considered
the
> same class.
>
> ie, you can't cast them
>
> ~
> Namaste - I bow to the divine in you
> ~
> Filip Hanik
> Software Architect
> [EMAIL PROTECTED]
> www.filip.net
>

Reply via email to