• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JSP unable to compile class error

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you Check the package name of ConnectDB.java file?
regds.
 
Saloon Keeper
Posts: 28392
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic