You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Barry Kimelman <bk...@sympatico.ca> on 2005/03/20 21:45:23 UTC

Rookie needs help resolving "HTTP Status 500" error message

 My system is a Windows XP PC running Tomcat 5.5.8

I have been able to compile and install my Tomcat project.
When I visit the URL corresponding to my Tomcat project I see the "starting"
page I expected to see.
When I click on the "SUBMIT" button on the form on the main page, I receive
the following error message from Tomcat :

 ========================================
HTTP Status 500 -
type Exception report
message 
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception 
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type

An error occurred at line: 8 in the jsp file: /logon.jsp
Generated servlet error:
DatabaseBean cannot be resolved or is not a type
 ==================================================

The contents of the named JSP file is as follows :

<%@ page language="java" contentType="text/html" %>
<%-- This JSP is to test my own personal Bean/class. --%>
<html>
<head>
<title>Logon</title>
</head>
<body>
<jsp:useBean id="foobar" scope="session" class="DatabaseBean" />
<jsp:setProperty name="foobar" property="*" />

<%-- First call the method that generates the data --%>
<%
 foobar.user_logon();
%>

<%-- Now call the method that retrieves the generated data --%>
<%= foobar.getHtmldata() %>

</body>
</html>

====================================================

I checked the directory structure where my Tomcat project was deployed and I
found that my class file DatabaseBean.class file was located under the
WEB-INF\classes sub-directory as expected. So why am I receiving the error
message from Tomcat ? Is there something I need to do to set the value for
CLASSPATH ?



*************************
 
Barry Kimelman
Toronto, Ontario, Canada
email :  bkimelman@sympatico.ca , bkimelman@hotmail.com

Re: Rookie needs help resolving "HTTP Status 500" error message

Posted by Mark Leone <mi...@cox.net>.
And be advised that you have to recapitulate your package structure in 
the directory hierarchy under ..WEB-INF\classes. In other words, if you 
compile your bean inside package org.company.my.java, then you should 
place the class file for your bean in ..WEB-INF\classes\org\company\my\java

QM wrote:

>On Sun, Mar 20, 2005 at 03:45:23PM -0500, Barry Kimelman wrote:
>: An error occurred at line: 8 in the jsp file: /logon.jsp
>: Generated servlet error:
>: DatabaseBean cannot be resolved or is not a type
>: [snip]
>: <jsp:useBean id="foobar" scope="session" class="DatabaseBean" />
>: [more snip]
>
>The error message indicates that the class "DatabaseBean" is not in a
>package, such as
>	com.someproject.DatabaseBean
>
>Packageless classes are discouraged, and will not load under Tomcat 5.x
>and later (aka servlet spec 2.3 and later).
>
>Put your DatabaseBean class in a package and this error should fade
>away.
>
>-QM
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Rookie needs help resolving "HTTP Status 500" error message

Posted by QM <qm...@brandxdev.net>.
On Sun, Mar 20, 2005 at 03:45:23PM -0500, Barry Kimelman wrote:
: An error occurred at line: 8 in the jsp file: /logon.jsp
: Generated servlet error:
: DatabaseBean cannot be resolved or is not a type
: [snip]
: <jsp:useBean id="foobar" scope="session" class="DatabaseBean" />
: [more snip]

The error message indicates that the class "DatabaseBean" is not in a
package, such as
	com.someproject.DatabaseBean

Packageless classes are discouraged, and will not load under Tomcat 5.x
and later (aka servlet spec 2.3 and later).

Put your DatabaseBean class in a package and this error should fade
away.

-QM

-- 

software   -- http://www.brandxdev.net
tech news  -- http://www.RoarNetworX.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org