my dog learned polymorphism*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP unable to compile class error" Watch "JSP unable to compile class error" New topic
Author

JSP unable to compile class error

Anthony Leroy
Greenhorn

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\_0002fjsp_0002fshowall_0002ejspshowall_jsp_0.java:64: Class jsp.ConnectDB not found.
ConnectDB connectDB = null;
^
C:\Tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fshowall_0002ejspshowall_jsp_0.java:67: Class jsp.ConnectDB not found.
connectDB= (ConnectDB)
^
C:\Tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fshowall_0002ejspshowall_jsp_0.java:72: Class jsp.ConnectDB not found.
connectDB = (ConnectDB) Beans.instantiate(getClassLoader(), "ConnectDB");
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:247)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown 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.
Thanks,
Ant
Swami nathan
Ranch Hand

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

SCJP, SCWCD, SCEA
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

"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.


Customer surveys are for companies who didn't pay proper attention to begin with.
DAYANAND BURAMSHETTY
Ranch Hand

Joined: Aug 06, 2001
Posts: 34
Hi,
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="com.mm.ex.ConnectDB" %>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: http://aspose.com/file-tools
 
subject: JSP unable to compile class error
 
Similar Threads
JSP in Tomcat !!!
JSP/JDBC problem
Internal Servlet Error with JSP + Tomcat 3.2.3
basic jsp question
running a Tomcat example