出现内部错误 jsp连接数据库

错误码Type Exception Report

Message org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WebRoot._001_jsp

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WebRoot._001_jsp
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:572)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WebRoot._001_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:381)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause

java.lang.ClassNotFoundException: org.apache.jsp.WebRoot._001_jsp
java.net.URLClassLoader.findClass(URLClassLoader.java:381)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:59)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:381)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/9.0.7

代码
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>



SELECT ����

url="jdbc:mysql://localhost:3306/runoob?useUnicode=true&characterEncoding=gb2312"
user="root" password="ppnn13%"/>


SELECT * from websites;
/sql:query

JSP ���ݿ�ʵ�� - ����̳�

ID վ���� վ���ַ


3个回答

tomcat lib包缺少jstl.jar,jsp页面使用该标签没,需要引入jar;
或者是版本问题,jdk版本一致,还不行驱动包换个版本试试

缺少连接数据库的驱动jar包

zhshuzi
zhshuzi 有驱动啊
大约 2 年之前 回复

连接数据库的驱动jar包,lib文件下。。。

zhshuzi
zhshuzi 可是那个驱动我已经有了啊 是不一样的MySQL版本驱动也不一样吗
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐