wood burning stoves*
The moose likes Servlets and the fly likes JSP -Class not found Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP -Class not found Error" Watch "JSP -Class not found Error" New topic
Author

JSP -Class not found Error

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Currently trying to create a web application, under TomCat
server.
I have copied all my jsp files to \examples\jsp directory, relative to where I installed TomCat.
Copied .class files under the \examples\WEB-INF\classes
Copied .jpg and .gif into \examples\jsp\images
I kick off tomcat ok, but on entering: http://127.0.0.1/examples/jsp/cats.jsp I get the following
error:-
-----------------------------------------------
Error: 500
Location: /examples/jsp/cats.jsp
Internal Servlet Error:
org.apache.jasper.JasperException:
Unable to compile class for JSPC:\TomCatDir\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fcats_0002ejspcats_jsp_0.java:66:
Class jsp.catBean not found.
catBean categories = null;
^
C:\TomCatDir\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fcats_0002ejspcats_jsp_0.java:69: Class jsp.catBean not found.
categories= (catBean)
^
----------------------------------------------
My cats.jsp file is as follows:-
<html>
<head>
<title>
The VSJ Widget Store
</title>
<%@ page language="java" %>
</head>
<body>
<table border="0" width="320">
<tr>
<td><center><h1>The VSJ Widget Store</center></h1></td></tr>
<tr>
<td><b>Welcome!</b>   Please click on whatever interests you.</td></tr>
<jsp:useBean id="categories" class="catBean" scope="page" />
<%
categories.makeConnection();
%>
<%
if (categories.getCategories())
{
while (categories.getNextCat()) {
%>
<tr><td><br><a href='store.jsp?catid=<%= categories.getColumn("catid") %>'>
<center><h2><%= categories.getColumn("catname") %></a></h2></center>
</td></tr>
<%
} /* of while */
} /* of if */
%>
<% categories.takeDown();
%>
</table>
</body>
</html>
My catBean.java file contains:-
import java.sql.*;
import java.io.*;
public class catBean extends sqlBean
{
String myCatSQL = "select * from category";
ResultSet myResultSet = null;
public catBean() {super();}
public boolean getNextCat() throws Exception
{
return myResultSet.next();
}
public String getColumn( String inCol) throws Exception
{
return myResultSet.getString(inCol);
}
public boolean getCategories() throws Exception
{
String myQuery = myCatSQL;
Statement stmt = myConn.createStatement();
myResultSet = stmt.executeQuery(myQuery);
return (myResultSet != null);
}
}
Can any body help!.
It looks as if the jsp can't locate the class file, I thought
CLASSPATH took care of that??.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have exactly the same question as the
"JSP -Class not found Error" topic.
Did this get resolved? I relly need to know! Let me know at smirnov@colorado.edu
Thank you in advance!
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"MartinL",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

It looks like your servlet is looking for jsp.catBean

So under your \examples\WEB-INF\classes, you should have a jsp folder with the catBean.class file inside.

Perhaps there is a packaging error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP -Class not found Error
 
Similar Threads
JSP
Has anyone seen this error before??
Please Help, Thanks william,sainudheen, Bear ..
using Multiple submit buttons.
web application in eclipse 9