无法将战争部署到 Tomcat

M-B*_*NCH 2 tomcat spring-boot microservices

将应用程序 war 部署到服务器时出现此错误:

12-Sep-2018 10:21:54.726 SEVERE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.processAnnotationsJar Unable to process Jar entry [module-info.class] from Jar [file:/xxx/apache-tomcat-8.0.41_xxxx/webapps/xxx/WEB-INF/lib/jaxb-api-2.3.0.jar] for annotations
Run Code Online (Sandbox Code Playgroud)
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
Run Code Online (Sandbox Code Playgroud)

信息:

  1. 应用程序是使用 Spring Boot 创建的微服务
  2. 使用的 Java 是版本 8
  3. Tomcat 版本:tomcat-8.0.41

谢谢你。

And*_*son 5

module-info.class 是 Java 9 中引入的 Java 模块系统的模块描述符。Tomcat 8.0 中的某些代码无法读取该类文件中的字节码,因此部署失败。

我相信这是 Tomcat 8.0 的限制,已在 8.5 中修复。另请注意,8.0 已发布停产公告,因此即使没有此问题,您也应计划尽快升级。