John: You mentioned that sometime the whole thing stoped working! Do you know the exact situation in which it stopped working? This is because in (some) servlet engines, the class loader for Server and JSP are different (in most of the JSP engines). That means, when the tomcat server starts, it loads the servlets using the classloader specific for Servlet and the JSPs (first compiled into classes) are loaded by JSP class loaders. Check it out. Balajii -----Original Message----- From: Geeta Ramani [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 2:54 PM To: [EMAIL PROTECTED] Subject: Re: ClassCastException when passing a list of Beans from ServlettoJSP page Hi Manish: You seem to be running JRun (from your later message).. I believe then the default place to put these is within a folder in something like /usr/local/jrun/jsm-default/services/jse/servlets/jsp/ unless you specifically wanted to put them elsewhere, when you configured JRun. I am not *exactly* sure becuase we changed from Jrun to tomcat a few months ago, but I believe I am close.. So poke around the above directory and you will find something.. Or, as a last resort, read the Jrun docs..! ;-) Geeta Manish Shah wrote: > hi geeta, > how do you have have the codes for the generated > servlets from the JSP....this will make my life easier > with debugging.. > manish > --- Geeta Ramani <[EMAIL PROTECTED]> wrote: > > Hi John: > > > > Since you have a "java.lang.ClassCastException" as > > the reported exception, I would > > guess that it is the statement: > > layer = (LayerBean)i.next(); > > that is causing the trouble. Some place in your > > servlet, you maybe are storing an > > object which is not a LayerBean in your vector > > (named "list" in the session > > variable)?? You may want to look at every place > > where you store something in this > > vector, and maybe you will find some one or more > > places where you are saving > > something which is not a LayerBean. (This may also > > explain why restarting the > > server seems to make the problem "go away".) > > > > If you want to be certain about where exactly the > > sever is running into trouble > > with your jsp, you may want to look at the generated > > servlet and go to the line > > number where the reported execption occurs. This > > will take the guess work out of > > your debugging.. > > > > Cheers! > > Geeta > > > > John Cartwright wrote: > > > > > 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 > > > > > ___________________________________________________________________________ > > 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 > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ > > ___________________________________________________________________________ > 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 ___________________________________________________________________________ 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 ___________________________________________________________________________ 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 ___________________________________________________________________________ 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
