maven集成tomcat7启动时一切正常,不过一旦访问页面就报异常:
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
环境:
jdk1.8 maven tomcat7-maven-plugin 2.0
原因:
tomcat7-maven-plugin 2.0 不支持 jdk 1.8,换成 tomcat7-maven-plugin 2.2版本就行,修改pom配置如下:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<mode>context</mode>
<contextFile>src/main/webapp/META-INF/context.xml</contextFile>
<url>http://localhost:8080/manager/text</url>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<protocol>org.apache.coyote.http11.Http11NioProtocol</protocol>
</configuration>
</plugin>