码迷,mamicode.com
首页 > 其他好文 > 详细

记一次IDEA 打包环境JDK版本和生产环境JDK版本不一致引发的血案

时间:2019-08-09 23:22:58      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:code   error   rtu   java   root   switch   druid   运行   contex   

问题描述:

本地开发环境idea中能正常运行项目,而idea打war包到Linux服务器的Tomcat下却不能正常运行,报如下错误:

09-Aug-2019 08:56:06.878 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal 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.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
09-Aug-2019 08:56:07.024 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] 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.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.mysql.jdbc.Driver] 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的作用):

    Manifest-Version: 1.0
    Built-By: Administrator
    Created-By: Apache Maven 3.5.0
    Build-Jdk: 1.8.0_161

记一次IDEA 打包环境JDK版本和生产环境JDK版本不一致引发的血案

标签:code   error   rtu   java   root   switch   druid   运行   contex   

原文地址:https://www.cnblogs.com/monkjavaer/p/11329871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!