[求助]jsp不能连接mysql数据库
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/aspectj/lang/Signature
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.DataWeb.test_jsp._jspService(org.apache.jsp.DataWeb.test_jsp:63)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:164)
org.apache.jsp.DataWeb.test_jsp._jspService(org.apache.jsp.DataWeb.test_jsp:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
test.jsp:
<%@page contentType="text/html;charset=gb2312"%>
<%
java.sql.Connection conn;
java.lang.String strConn;
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/test1","root","");
%>
连接mysql数据库成功
<%
} catch (java.sql.SQLException e) {
out.println(e.toString());
}
%>
以上是我的错误及代码,谢谢帮忙!!!!!!!!!!!!帮我解决下
搜索更多相关主题的帖子:
数据库 jsp mysql
----------------解决方案--------------------------------------------------------
帮帮忙啊
----------------解决方案--------------------------------------------------------
NoClassDefFoundError
----------------解决方案--------------------------------------------------------
你在localhost该成localhost:3306
----------------解决方案--------------------------------------------------------