jsp项目本地可用,云服务不可以用

用idea写的jsp,然后导出war包,本地(tomcat 9.0,jdk 1.8)项目可用,部署到服务器
(tomcat 8.5 jdk 1,7)就出错了
错误代码

 Exception report

message An exception occurred processing JSP page /index.jsp at line 95

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 /index.jsp at line 95

92: <div class="shoes">
93:     <div class="container">
94: <%
95:     Vector<Car> cars = new Dao().getCar();
96:     int k=1;
97:     out.print("         <div class=\"product-one\">\n");
98:     for(Car car:cars){


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:584)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: com/Dao/Dao
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:292)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.lang.UnsupportedClassVersionError: com/Dao/Dao
    org.apache.jsp.index_jsp._jspService(index_jsp.java:209)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
当年话下
浏览 385回答 3
3回答

富国沪深

java.lang.UnsupportedClassVersionError: com/Dao/Dao这句在提示类版本号错误,是个致命的Error试试本地用jdk1.7编译打包再上传,开发环境和部署环境不一致还是比较忌讳的

白衣染霜花

统一环境。

哔哔one

就是因为本机和服务器的JDK版本不一致
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java