• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP unable to compile class error

 
Anthony Leroy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you Check the package name of ConnectDB.java file?
regds.
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
DAYANAND BURAMSHETTY
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic