tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Horowitz <rhorow...@ni4u.com>
Subject Re: JSP exception question...help needed
Date Thu, 14 Sep 2000 17:27:38 GMT
Unfortunately, that did not help. I already have java.util.* on the
imports. Thanks anyway for trying :) Anybody else have any idea why I'm
seeing the problem outlined below?

TIA...Rick Horowitz

Kitching Simon wrote:
> 
> Hi,
> 
> This is just a wild guess..
> 
> Does your page that has the <jsp:useBean class="HashMap" ... > tag
> have a <%@ page import="java.util.HashMap" /> (or import="java.util.*")?
> 
> We use Oracle jDeveloper (which is derived from JBuilder), and have noticed
> it
> has a nasty habit of automatically importing the java.util package without
> any
> explicit statement. As far as I can see, this is non-standards-compliant
> behaviour. Whenever we move the code to tomcat, any page in which we use
> a class from java.util and have forgotten the import statement gives an
> error
> (it's usually Enumeration is the one that bites us).
> 
> Hope this helps,
> 
> Simon
> 
> > -----Original Message-----
> > From: Rick Horowitz [SMTP:rhorowitz@ni4u.com]
> > Sent: Wednesday, September 13, 2000 6:02 PM
> > To:   Tomcat UserGroup
> > Subject:      JSP exception question...help needed
> >
> > I'm new to Tomcat, so this is probably a usage problem, but I could
> > really use some help.
> >
> > I'm porting a jsp/servlet application that works on JRun3.0 to Tomcat
> > 3.2b3 and get an exception when my servlet tries to dispatch to
> > login.jsp using a RequestDispatcher.
> >
> > Here's my setup:
> >
> > Windows NT 4.0 sp5
> > Running Tomcat from JBuilder 3.5
> > Using jdk 1.3.
> >
> > I deployed my war file to the standard tomcat webapps directory.  Tomcat
> > serves the first couple of jsp's just fine until it gets to a point
> > where it tries to dispatch to login.jsp.
> >
> > It appears to me from the trace, below, that for some reason, JspServlet
> > cannot dispatch to my JSP because it is trying to instantiate a bean of
> > class HashMap.  login.jsp contains the following line, which I believe
> > is the bean reference that Tomcat is choking on:
> >
> > <jsp:useBean id="errorsMap" class="HashMap" scope="request" />
> >
> > I should note that on this particular invocation, the JSP will try to
> > create the bean, as it is not already in the http request.
> >
> > I suspect that this may be a classloader problem.  I have my JSPs in the
> > Tomcat webapps folder (I copy my .war file there and it is autoexpanded
> > when I restart Tomcat).  But the rest of my application is in other
> > directories that are added to the classpath by JBuilder.  If this is
> > indeed the problem, does anyone know how to use JBuilder so that I can
> > compile my servlets, beans and other helper files in JBuilder, then
> > create a .war file that includes them, but still be able to set
> > breakpoints in JBuilder?
> >
> > If this is not a classloader problem, then what???
> >
> > TIA...The Tomcat trace follows...
> >
> > Rick Horowitz
> >
> > ------ the Tomcat exception trace -----
> >
> > Error: 500
> > Location:/corban/jsp/login.jsp
> > Internal Servlet Error:
> >
> > javax.servlet.ServletException:  Cannot create bean of class HashMap
> >       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:386)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >       at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
> >       at org.apache.tomcat.core.Handler.service(Handler.java:263)
> >       at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
> >       at
> > org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherIm
> > pl.java:191)
> >       at
> > com.jammconsulting.servlet.AbstractServlet.service(AbstractServlet.java:11
> > 9)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >       at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
> >       at org.apache.tomcat.core.Handler.service(Handler.java:263)
> >       at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
> >       at
> > org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:
> > 749)
> >       at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
> >       at
> > org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Htt
> > pConnectionHandler.java:207)
> >       at
> > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
> >       at
> > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> >       at java.lang.Thread.run(Thread.java:484)
> >
> >
> > The login.jsp file that is being dispatched to when the error occurs
> > contains the following:
> >
> > <!-- pass a variable to included page -->
> > <% request.setAttribute("title", "Home Page"); %>
> > <%@ include file="/jsp/includes/header.jsp" %>
> > <%@ include file="/jsp/includes/formUtils.jsp" %>
> >       <p>You must login before accessing Corban Communications' Intranet.
> > Please
> >       enter your username and password and login as either an
> > administrator
> > or an
> >       employee.
> >
> >       <%      String errorMsg = (String)request.getAttribute("errorMsg");
> > %>
> >                       <p>
> >                       <font color="red">
> >       <%      out.print(errorMsg); %>
> >                       </font>
> >
> >               <table border="0" cellpadding="8" cellspacing="0">
> >                       <form name="login" action="servlet/Admin"
> > method="POST">
> >                               <%@ include
> > file="/jsp/includes/hiddenFields.jsp" %>
> >
> >                               <%=
> > formatTextField(request,"emailAddr","Email Address","") %>
> >                               <%=
> > formatPasswordField(request,"password","Password","") %>
> >
> >                       <tr>
> >                               <td align="center" colspan="2">
> >                                       <input type="submit"
> > name="adminLogin" value="Administrator"
> >
> > onclick="setHidden(login,'adminLogin')">
> >                                       &nbsp;&nbsp;&nbsp;
> >                                       <input type="submit"
> > name="employeeLogin" value="Employee"
> >
> > onclick="setHidden(login,'emplLogin')">
> >                               </td>
> >                       </tr>
> >                       </form>
> >               </table>
> >
> > <%@ include file="/jsp/includes/footer.jsp" %>
> >
> > -------
> >
> > Any help would be greatly appreciated.
> >
> > Thanks,
> >
> > Rick Horowitz

Mime
View raw message