java - 从 JBoss 4.2 迁移时出现 JBoss wildfly 10 NoClassDefFoundError

标签 java module addition wildfly jericho-html-parser

我有一个运行到 JBoss 4.2 中的 spring mvc 应用程序。我正在尝试将此 Web 应用程序迁移到 JBoss wildfly 10(wildfly-10.0.0.Final 版本)。

当我尝试部署我的应用程序时显示此错误:

"{\"WFLYCTL0080: Failed services\" => {\"jboss.deployment.unit.\\\"myApp.war\\\".POST_MODULE\" => \"org.jboss.msc.service.StartException in service jboss.deployment.unit.\\\"myApp.war\\\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \\\"myApp.war\\\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.ajaxtags.tags.AjaxDisplayTag with ClassLoader ModuleClassLoader for Module \\\"deployment.myApp.war:main\\\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: au/id/jericho/lib/html/Segment
Caused by: java.lang.ClassNotFoundException: au.id.jericho.lib.html.Segment from [Module \\\"deployment.myApp.war:main\\\" from Service Module Loader]\"}}"

在网上查找时,我读到我需要加载 jar“jericho-html-2.6.1.jar”。为此,我添加了 ${wildfly_home}/modules/system/layers/base/au/id/jericho/lib/html/main jericho-html-2.6.1.jar 和此 module.xml

<?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="au.id.jericho.lib.html">
    <resources>
        <resource-root path="jericho-html-2.6.1.jar"/>
    </resources>
    <dependencies>
    </dependencies>
</module>

我在standalone.xml中添加了扩展

<extension module="au.id.jericho.lib.html"/>

但我遇到了同样的错误。

最佳答案

为什么要在standalone.xml中添加扩展名? 您应该将 WEB-INF/jboss-deployment-struct.xml 文件添加到您的 war 中:

<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="au.id.jericho.lib.html" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

关于java - 从 JBoss 4.2 迁移时出现 JBoss wildfly 10 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39038968/

相关文章:

module - Node.JS错误: Cannot find module 'posix' (using Cygwin)

java - java中添加未知数量的数字

java - 基于网络的点对点客户端使用什么技术

java - RecyclerView 插入动画中断 OnClick

module - 更改 Dotnetnuke 中特定页面的外观

swift - 如何在 Swift 中使用静态库和模块映射文件?

java - Struts2属性标签默认转义属性

java - Apache POI 边框样式不起作用

c++ - 在这种情况下, 'addition' 和 'bitwise or' 是否相同?

java - 为 PositionalList 添加方法