当前位置: 代码迷 >> Java Web开发 >> JSP连mysql的时候出现了有关问题!望一下!谢了
  详细解决方案

JSP连mysql的时候出现了有关问题!望一下!谢了

热度:524   发布时间:2016-04-17 14:46:40.0
JSP连mysql的时候出现了问题!望高手指点一下!!谢了!
<%@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
  相关解决方案