问答详情
源自:-

课程源码运行不了

点南放入购物车,出现以下错误:

ype Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.Error: Unresolved compilation problems:
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Map.Entry cannot be resolved to a type
The method entrySet() from the type HashMap<Items,Integer> refers to the missing type Map$Entry
Map.Entry cannot be resolved to a type

entity.Cart.<init>(Cart.java:1)
servlet.CartServlet.addToCart(CartServlet.java:110)
servlet.CartServlet.doPost(CartServlet.java:72)
servlet.CartServlet.doGet(CartServlet.java:49)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.2 logs.

Apache Tomcat/7.0.2


提问者:夜深千丈灯 2015-07-11 23:53

个回答

  • xamilanlover
    2015-07-13 10:02:22
    已采纳

    问题:项目能正常启动,但在系统登录时却报错!MyEclipse 报错问题。

    原因:由于电脑上安装了多个JDK版本,而MyEclipse IDE 使用默认版本,使得 IDE 的Compiler Compliance level 与 Installed JREs 版本不对应而导致错误。

    解决方案:将 IDE 的Compiler Compliance level 与 Installed JREs 版本修改为一致。(例如:Compiler Compliance level 使用1.5时,Installed JREs版本则使用jdk1.5.0 )