Meaningless Drivel is fun!
The moose likes Servlets and the fly likes JSP unable to compile class error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP unable to compile class error" Watch "JSP unable to compile class error" New topic

JSP unable to compile class error

Anthony Leroy

Joined: Aug 02, 2001
Posts: 20
Hi, I know some have asked similar questions before and I have tried the suggestions that were given in the replies but none have worked.
I'm getting:
Error: 500
Location: /examples/jsp/showall.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPC:\Tomcat\work\localhost_8080%2Fexamples\ Class jsp.ConnectDB not found.
ConnectDB connectDB = null;
C:\Tomcat\work\localhost_8080%2Fexamples\ Class jsp.ConnectDB not found.
connectDB= (ConnectDB)
C:\Tomcat\work\localhost_8080%2Fexamples\ Class jsp.ConnectDB not found.
connectDB = (ConnectDB) Beans.instantiate(getClassLoader(), "ConnectDB");
3 errors
at org.apache.jasper.compiler.Compiler.compile(
at org.apache.jasper.runtime.JspServlet.loadJSP(
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(
at org.apache.jasper.runtime.JspServlet.serviceJspFile(
at org.apache.jasper.runtime.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.tomcat.core.ServletWrapper.handleRequest(
at org.apache.tomcat.core.ContextManager.service(
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(
at Source)
my jsp file is in the c:\Tomcat\webapps\examples\jsp folder
and the class file (ConnectDB) is in the c:\Tomcat\webapps\examples\web-inf\classes folder
Any suggestions would be greatly appreciated.
Swami nathan
Ranch Hand

Joined: Sep 30, 2000
Posts: 57
Did you Check the package name of file?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

"Class jsp.ConnectDB not found"
Unless you actually HAVE a package named "jsp" which contains a class named "ConnectDB", it looks like you didn't supply the java import statement for the package that actually does contain class ConnectDB.

An IDE is no substitute for an Intelligent Developer.
Ranch Hand

Joined: Aug 06, 2001
Posts: 34
All class files keep into ..\web-inf\classes this directory
(like web-inf\classes\com ( com is the totaly package for
project..this one keep into the web-inf\classes directory).
If U r file in the com\mm\ex\ConnectDB.In jsp
U write <%@ page import="" %>this one.
IF I'm wrong Correct me.

Dil se....,<BR>Dayanand<BR>0065-8839071(off)<BR>0065-7547034(Res0
I agree. Here's the link:
subject: JSP unable to compile class error
It's not a secret anymore!