标题:[求助]jsp不能连接mysql数据库
只看楼主
yoyodo
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-12-8
 问题点数:0 回复次数:3 
[求助]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 
2006-05-22 16:21
yoyodo
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-12-8
得分:0 
帮帮忙啊
2006-05-22 20:13
dreame
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:521
专家分:0
注 册:2005-10-23
得分:0 
NoClassDefFoundError

有时候真的想放弃寂寞的等待,但她是那么的可爱!I love u forever!
2006-05-22 22:26
lixin1020
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2005-8-11
得分:0 
你在localhost该成localhost:3306

2006-05-24 15:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-66266-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.153296 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved