tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Horowitz <rhorow...@ni4u.com>
Subject JSP exception question...help needed
Date Wed, 13 Sep 2000 16:01:49 GMT
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(RequestDispatcherImpl.java:191)
	at
com.jammconsulting.servlet.AbstractServlet.service(AbstractServlet.java:119)
	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(HttpConnectionHandler.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