Does this happen when you change you beans? If you have jsps that use the beans 
with session scope then modifying the bean can cause this, especally if session 
object remains in the memory... Restarting your browser should also help.

*********************************************************************
* Boris Niyazov                Ph:  212-854-4094  Fax: 212-854-1749 *
* Systems Manager              Email: [EMAIL PROTECTED]             * 
* Columbia Law School          URL: http://www.law.columbia.edu     *
*********************************************************************                  
             


                                      

>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>list-help: <mailto:[EMAIL PROTECTED]>
>list-unsubscribe: <mailto:[EMAIL PROTECTED]>
>list-post: <mailto:[EMAIL PROTECTED]>
>Delivered-To: mailing list [EMAIL PROTECTED]
>Date: Wed, 25 Apr 2001 13:25:06 -0600
>From: John Cartwright <[EMAIL PROTECTED]>
>X-Accept-Language: en
>MIME-Version: 1.0
>To: [EMAIL PROTECTED]
>Subject: ClassCastException when passing a list of Beans to JSP page
>Content-Transfer-Encoding: 7bit
>X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
>
>Hello All,
>
>I am hoping someone can solve this mystery for me since I'm stumped.  
>
>I have a servlet which populates a vector with beans.  It then puts the
>vector into the request object and forwards to a JSP page.
>
>The JSP page pulls the vector out of the request and proceeds to call
>methods on each bean in the list.
>
>Sometimes the whole thing quits working and complains with a 
>
>Internal Servlet Error:
>javax.servlet.ServletException: sde.LayerBean
>...
>Root cause: 
>java.lang.ClassCastException: sde.LayerBean
>...
>
>Restarting tomcat solves the problem, but I'd like to understand what's
>going on. I'm assuming that it's the JSP page throwing the exception
>(the errorPage directive engages).
>
>Can someone enlighten me?  I'm using Tomcat 3.2.1 (standalone) on Linux
>JDK1.3.  The JSP page is listed below.
>
>Thanks!
>
> 
>-- john
>
>
><%@ page import="sde.LayerBean,java.util.*" %>
><html>
><body>
><%
>   Vector v = (Vector)request.getAttribute("list");
>   LayerBean layer;
>   Iterator i = v.iterator();
>   while (i.hasNext()) {
>      layer = (LayerBean)i.next();
>%>
><%=layer.getTableName()%><BR>
><% } %>
></body>
></html>
>
>
>
>
>
>===============================================================================
>John Cartwright
>Professional Research Assistant / Associate Scientist
>CIRES, SEG/NGDC/NOAA
>(303) 497-6284
>[EMAIL PROTECTED]
>===============================================================================

Reply via email to