【问题标题】:Spring Boot deployment on WLP (WebSphere Liberty) throws CWWKC0044W errorWLP (WebSphere Liberty) 上的 Spring Boot 部署引发 CWWKC0044W 错误
【发布时间】:2018-06-21 00:28:36
【问题描述】:

我有一个 Spring Boot 应用程序,它通过 Spring Boot Gradle 插件java -jar myApp.war 命令运行良好。

但是,如果我尝试在 WebSphere Liberty 应用服务器上部署它,我会收到以下错误:

[WARNING ] CWWKC0044W: An exception occurred while scanning class and annotation data. The exception was java.lang.RuntimeException
        at org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:148)
        at [internal classes]
.

此外,此错误会导致 Spring Boot 开始以DEBUG 严重性记录,即使它配置为INFOWARN

谁能指导我找出根本原因,或者如何深入调查?

我正在使用以下版本:

  • Spring Boot:2.0.0.M7
  • WLP:17.0.0.4
  • Java(内部版本):祖鲁 1.8.0_152
  • Java (WLP):IBM 8.0.5.6

以及以下依赖项:

dependencies {
    implementation "org.springframework.boot:spring-boot-starter-web:2.0.0.M7"
    implementation "org.springframework.boot:spring-boot-starter-thymeleaf:2.0.0.M7"

    providedRuntime "org.springframework.boot:spring-boot-starter-tomcat:2.0.0.M7"
}

我尝试了不同版本的 Spring Boot (1.5.9) 和 WLP (17.0.0.3),但错误没有改变。删除>


更新Spring Boot 1.5.9 中不存在该错误。

【问题讨论】:

    标签: spring spring-boot gradle websphere websphere-liberty


    【解决方案1】:

    您需要包含 Liberty spring boot starter,并排除 Tomcat starter(因为您使用的是 Liberty 而不是 Tomcat)。

    您的依赖项应如下所示:

    dependencies {
      ...
      // Include liberty and exclude tomcat
      compile('io.openliberty.boot:liberty-spring-boot-starter:0.5.0.M1')
      compile('org.springframework.boot:spring-boot-starter-web') {
        exclude module: "spring-boot-starter-tomcat"
      }
      ...
    }
    

    有关使用 Liberty+Spring 的基本 HelloServlet 的更详细演练,请查看 Tom Watson 的博客文章:Open Liberty Spring Boot Starter

    【讨论】:

    • spring-boot-starter-tomcat 已通过providedRuntime 有效排除 - 它不存在于已部署的 WAR 中。
    • 不,添加liberty-spring-boot-starter 不会改变任何事情。仍然,同样的错误。
    【解决方案2】:

    我能够通过排除 Log4j 传递依赖来摆脱错误。有必要从每个 spring-boot-starter-* 依赖项中删除它(在我的例子中是 webthymeleaf)。因此,我在全球范围内将其排除在外:

    configurations {
        implementation {
            exclude group: 'org.apache.logging.log4j'
        }
    }
    

    我用的是Gradle 4,所以配置是implementation。对于旧版本,它应该是 compile

    但是,我仍然不知道根本原因是什么,所以一些解释会很好。我怀疑一些较旧/不兼容的 Java 版本。

    【讨论】:

    • 能否请您添加您的 server.xml 配置我有同样的问题
    • 很遗憾,这是我过去的工作,所以我不再可以使用时间配置了。
    猜你喜欢
    • 1970-01-01
    • 2016-02-26
    • 2019-07-21
    • 1970-01-01
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多