jsp连接数据库SQlserver2005时出现如下错误,求高手指点 :
typeExceptionreportdescriptionTheserverencounteredaninternalerror()thatpreventeditfro...
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.result_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
jsp代码如下:<%@page contentType="text/html,charset=GB2312 ",language="java"%>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<% Connection con;
statement sql;
ResultSet rs;
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch(ClassNotFoundException e)
{
out.print("类找不到!");
}
try
{
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ysb","sa"," 222222y");
sql=con.CreateStatement();
rs=sql.executeQuery("SELECT *FROM flight");
......
</BODY>
</HTML>
数据库的jdbc驱动已经放到了tomcat的lib 目录下,数据库sql server 2005的1433端口也开了,tomcat版本为6.0. 32,能显示测试首页,jdk版本为 jdk1.6.0_23,能在cmd中显示版本。
到底哪出问题了,头都大了,%>_<%! 展开
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.result_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
jsp代码如下:<%@page contentType="text/html,charset=GB2312 ",language="java"%>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<% Connection con;
statement sql;
ResultSet rs;
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch(ClassNotFoundException e)
{
out.print("类找不到!");
}
try
{
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ysb","sa"," 222222y");
sql=con.CreateStatement();
rs=sql.executeQuery("SELECT *FROM flight");
......
</BODY>
</HTML>
数据库的jdbc驱动已经放到了tomcat的lib 目录下,数据库sql server 2005的1433端口也开了,tomcat版本为6.0. 32,能显示测试首页,jdk版本为 jdk1.6.0_23,能在cmd中显示版本。
到底哪出问题了,头都大了,%>_<%! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询