"Kumar, Amit" wrote:
> Hi,
>
> I have a Vector v which contains object People.
> I put this vector into the session in one servlet (s1).
> I am using RequestDispatcher method to call second servlet (s2).
>
> In s2 when I try to get values from the vector I get ClassCastException
> People p = (People)(v.elementAt(i));
>
> Any help would be appreciated.
>
> Thanks
> Amit
> [...]
Hi :-) I am not sure, but I guess perhpas we can find the reason
by the the following:
* Do the two classloaders of the following
have the same hashCode?
- HttpSession(s1), HttpSession(s2)
- Vector(s1), Vector(s2)
- v.elementAt(i)(s1), v.elementAt(i)(s2)
with:
...
X.getClass().getClassLoader().hashCode()
...
* Do the above have the same hashCode?
- HttpSession(s1), HttpSession(s2)
- Vector(s1), Vector(s2)
- v.elementAt(i)(s1), v.elementAt(i)(s2)
with:
...
X.hashCode()
...
* in s1 when you put a instance of People into
Vector(s1) and put Vector(s1) into session(s1),
is it "directly" or "shallow colone" or "deep colone"?
Can s1 and s2 Both access the Class People?
Bo
Feb.22, 2001
___________________________________________________________________________
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