jsp通过jdbc访问oracle数据库之异常jre路径错误(转)

jsp通过jdbc访问oracle数据库之异常

HTTP Status 500 -

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

type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
 org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
 org.apache.jsp.jsp.DbConn_jsp._jspService(DbConn_jsp.java:122)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
 org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
 org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 java.lang.Class.forName0(Native Method)
 java.lang.Class.forName(Class.java:169)
 org.apache.jsp.jsp.DbConn_jsp._jspService(DbConn_jsp.java:88)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.


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

Apache Tomcat/6.0.16

很明显:
classes12.jre未导入或导入路径出错。
解决方案:
将classes12.jre文件放到以下路径(二选一):
1.apache-tomcat-6.0.16\lib\(此种方法以后不必单独未某个工程添加classes12.jre文件)
2.放在apache-tomcat-6.0.16\webapps\你的工程\WEB-INF\lib\