gpt4 book ai didi

java - Tomcat 6/7,Java 8 : Can't compile JSP: [various types] cannot be resolved

转载 作者:行者123 更新时间:2023-11-28 22:50:51 25 4
gpt4 key购买 nike

请注意:此问题不涉及 ECLIPSE!

我在命令行上使用 Maven。尝试使用 Tomcat7 插件的 run-war 目标导致

Oct 11, 2016 11:11:52 AM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet threw load() exception org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the generated java file The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 1 in the generated java file The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 32 in the jsp file: /header.jsp The type java.nio.CharBuffer cannot be resolved. It is indirectly referenced from required .class files

(还有很多这样的行)

这段代码在过去运行没有任何问题,我无法理解这样的基础类是如何“无法解析”的。

使用 Tomcat6 插件同样严重失败,但失败被推迟到首次调用 JSP 时而不是在启动时。

我怀疑这与 Java8 有关,因为在涉及 Eclipse 的类似问题的答案中已经提到了这一点(ONCE AGAIN:此处不涉及 Eclipse),但我不知道纠正措施是什么。我们不能简单地退回到 Java 7,因为有大量在目标 1.8 上编译的依赖项无法合理地重新编译。

最佳答案

想通了。需要将 tomcat7 插件从 2.0 版升级到 2.2 版。

关于java - Tomcat 6/7,Java 8 : Can't compile JSP: [various types] cannot be resolved,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39984692/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com