<%@page contentType= "text/html;charset=gb2312 "%>
<%@ page import= "com.mysql.jdbc.Driver.* " %>
<%@page import= "java.sql.* "%>
<%
try{
Class.forName( "com.mysql.jdbc.Driver ");
Connection conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/test ", "root ", " ");
if(conn!=null)
out.println( "数据库连接成功! ");
conn.close();
}
catch(ClassNotFoundException e) {
out.println( "找不到驱动程序 ");
}
catch(SQLException e) {
out.println( "sql ");
}
%>
出现以下错误:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /do.jsp at line 6
3: <%@page import= "java.sql.* "%>
4: <%
5: try{
6: Class.forName( "com.mysql.jdbc.Driver ");
7: Connection conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/test ", "root ", "rubbish ");
8: if(conn!=null)
9: out.println( "数据库连接成功! ");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.do_jsp._jspService(do_jsp.java:81)
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:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NoClassDefFoundError: org/aspectj/lang/Signature