tomcat启动web项目报错汇总
- 前言
- 问题
- org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application...
- Tomcat启动时:Mapped Statements collection already contains value for ...
- java: 找不到符号 符号: 方法 getType() 位置: 类型为com.mtwl.vehicle.carflow.p
- java: -source 7 中不支持 lambda 表达式 (请使用 -source 8 或更高版本以启用 lambda 表达式)
前言
简单记录一下tomcat部署web项目时候的一些错误,持续更新…
问题
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application…
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
问题描述
接口重载之后,打包部署到Tomcat的时候出现了如下问题:
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
解决方案
查看tomcat日志文件:
映射没改,tomcat进行加载的时候无法进行区分请求,也就是两个映射接口冲突了。
只要修改其中一个路径即可。
Tomcat启动时:Mapped Statements collection already contains value for …
问题描述
在tomcat启动的时候,报了该错误,很明显是因为Mapper对应的xml文件中id冲突了,因为Mybatis中所有的语句都要id唯一!
<select id="selectTaskCountByTime" resultType="int">
</select>
<select id="selectTaskCountByTime" resultType="map">
</select>
解决方案
删除重复的定义即可,修改后:
<select id="selectTaskCountByTime" resultType="map">
</select>
java: 找不到符号 符号: 方法 getType() 位置: 类型为com.mtwl.vehicle.carflow.p
问题描述
将项目部署到另一台机器时,用的是idea自带的Maven,tomcat、JDK版本一致的情况下报了这个错。
解决方案
首先mvn clean,然后再mvn install,查看是否classes都存在,发现是存在的情况下,考虑是否lombok冲突,因为getXXX()方法一看就是domain中常见的get、set。
最后通过提高lombok的版本,问题解决。
原先版本:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.20</version>
</dependency>
修改后:同时为了避免冲突,加上provided
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
java: -source 7 中不支持 lambda 表达式 (请使用 -source 8 或更高版本以启用 lambda 表达式)
问题描述
将项目部署到另一台机器时,用的是idea自带的Maven,tomcat、JDK版本一致的情况下报了这个错。
问题解决
-
修改jave compiler的version
-
查看tomcat 的 java 版本
-
查看整个project的java环境
持续更新中…