greetings:

I have a servlet that has a user defined object embedded in the session.
This object is added to the session in a one servlet,
then accessed by other servlets which might need it.  In this code section,
the object has already been placed into the session.

  public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
  {
    response.setContentType("text/html");

    HttpSession session = request.getSession(true);
    NetUser user = (NetUser)session.getValue("USER");  // User defined
object
    PrintWriter out = new PrintWriter (response.getOutputStream());

    if( session == null || user == null)
    {
      NoSessionPage page = new NoSessionPage(out);
      out.close();
    }
    .
    .
    .
 }
This worked just fine until...later in the code, the user object is passed
to an RMI service.  Now, if the page is accessed again after executing, I
get a BadCast exception trying to cast the user object back to my defined
type.  I'm using the JavaSoft webserver, and if i restart it, the code works
fine again...the first time through.  Is the RMI call screwing up my object?
The RMI method does nothing to the object except extract information from
it.  I'm baffled.

Bill A. Rawlings
Manager, Applications Software Engineering
Lockheed Martin Management & Data Systems
Reconnaissance Systems
(623) 925-7574

___________________________________________________________________________
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