By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,918 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,918 IT Pros & Developers. It's quick & easy.

i hav a problem with JSP and mysql

P: 26
when i'm using a simple JSP-mysql code it shows some HTTP status 500 error.But simple JSP program without databse is running , Please help how to solve this problem. I'm new to JSP.
my configurations are...


i installed j2sdk in C:\j2sdk1.4.2_16

then installed jakarte-tomcat in C:\Program Files\Apache Tomcat 4.0 folder

copied mysql-connector-java-3.0.17-ga-bin.jar to C:\Program Files\Apache Tomcat 4.0\common\lib


CLASSPATH: C:\j2sdk1.4.2_16\lib\tools.jar;C:\j2sdk1.4.2_16\jr e\lib\rt.jar;C:\Program Files\Apache Tomcat 4.0\common\lib\mysql-connector-java-3.0.17-ga-bin.jar;

PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\j2sdk1.4.2_16\bin;

JAVA_HOME: C:\j2sdk1.4.2_16\;

TOMCAT_HOME: C:\Program Files\Apache Tomcat 4.0\;


error are given below
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error

--------------------------------------------------------------------------------

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: com.mysql.jdbc.Driver
at org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:457)
at org.apache.jsp.test$jsp._jspService(test$jsp.java: 92)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.p rocess(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.r un(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:534)


root cause

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1307)
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1156)
at org.apache.jasper.servlet.JasperLoader.loadClass(J asperLoader.java:198)
at org.apache.jasper.servlet.JasperLoader.loadClass(J asperLoader.java:132)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.apache.jsp.test$jsp._jspService(test$jsp.java: 71)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.p rocess(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.r un(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:534)
Feb 21 '08 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Apparently the mysql driver class is not being found.
Check that your classpath really is set correctly.
Feb 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.