问题描述:
本地开发环境idea中能正常运行项目,而idea打war包到Linux服务器的Tomcat下却不能正常运行,报如下错误:
09-Aug-2019 08:56:06.878 SEVERE [localhost-startStop-1] org.a One or more listeners failed to start. Full details will be found in the appropriate container log file 09-Aug-2019 08:56:06.924 SEVERE [localhost-startStop-1] org.a Context [] startup failed due to previous errors 09-Aug-2019 08:56:07.024 WARNING [localhost-startStop-1] org.a The web application [ROOT] registered the JDBC driver [com.alibaba.druid.] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 09-Aug-2019 08:56:07.024 WARNING [localhost-startStop-1] org.a The web application [ROOT] registered the JDBC driver [com.my] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.问题排查:
IDEA 打包环境JDK版本和Linux生产环境JDK版本不一致,导致线上Tomcat无法正常运行
解决方案:
- 1、确保两边环境安装相同的jdk版本
- 2、选择idea导航栏中Help -》Find Action,在弹框中输入Switch Boot JDK,在select Boot JDK中选择本机jdk版本,然后重启,在idea的Terminal运行java -version命令确认:
- 3、打包后检查war包内META-INF下的MANIFEST.MF文件,查看编译环境,确保jdk版本(get以下META-INF的作用):
1.《如何查看本地jdk版本号、查看jdk版本号命令!》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。
2.《如何查看本地jdk版本号、查看jdk版本号命令!》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。
3.文章转载时请保留本站内容来源地址,https://www.lu-xu.com/keji/3329665.html