課程源碼運(yùn)行不了
點(diǎn)南放入購物車,出現(xiàn)以下錯誤:
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-13
問題:項(xiàng)目能正常啟動,但在系統(tǒng)登錄時卻報(bào)錯!MyEclipse 報(bào)錯問題。
原因:由于電腦上安裝了多個JDK版本,而MyEclipse IDE 使用默認(rèn)版本,使得 IDE 的Compiler Compliance level 與 Installed JREs 版本不對應(yīng)而導(dǎo)致錯誤。
解決方案:將 IDE 的Compiler Compliance level 與 Installed JREs 版本修改為一致。(例如:Compiler Compliance level 使用1.5時,Installed JREs版本則使用jdk1.5.0 )
?