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]
===============================================================================

___________________________________________________________________________
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