在Intellij里运行tomcat打开项目是可以在浏览器上打开这个页面的,然后我Jenkins里部署也好了,也提示tomcat启动成功,但是浏览器访问就出以下错误(这里是片段),看样子是jdbc连接问题
Type Exception Report
Message An exception occurred processing [index.jsp] at line [3]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [index.jsp] at line [3] 1: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 2: <html> 3: <jsp:forward page="/showMenus"></jsp:forward> 4: </html> Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:626) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:500) 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.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. ### The error may exist in com/lesson/dao/MenuDAO.java (best guess) ### The error may involve com.lesson.dao.MenuDAO.getMenuByMidCid ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; n
问题解决了吗?求解
你看看你tomcat启动日志有没有报错