We have a servlet that checks if there is a session and if so, checks for
a session value "UserInfo". If both aren't there, it puts its URL into the
session and calls the LoginServlet. After the user logs in, the LoginServlet
populates a class 'ExtranetUser' and creates a session, and puts it in the
session as "UserInfo" with session.putValue( "UserInfo", userInfo ).
userInfo is a newly instantiated and populated ExtranetUser object. It then
extracts the URL from the session and redirects back to the application.

Back at the app, the session and "UserInfo" object are there, but the
following call fails with ClassCastException:
ExtranetUser user = (ExtranetUser)session.getValue( "UserInfo" );

How could this be? There is only one ExtranetUser class on the system, so
there's not a chance there are different versions. If we change the cast to
(Object)session.getValue "UserInfo") and then do a user.toString, we get
"com.hersheys.login.ExtranetUser@314320" so we know it's the right
class/package!. We tried fully qualifying the cast and the declaration above
with com.hersheys.login but that doesn't make a difference. The application
is in a webapp under IBM WebSphere 3.02. We know that both servlets can pass
info through the session because the app puts its URL there and the login
uses it to redirect back and that is working.

We've been trying to figure this out all day. Can anyone help? Thanks!

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to