从JBoss 4.2迁移时JBoss wildfly 10 NoClassDefFoundError

时间:2016-08-19 12:22:50

标签: java module add 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"/>

但我得到同样的错误。

1 个答案:

答案 0 :(得分:2)

为什么要在standalone.xml中添加扩展名? 您应该使用以下命令为您的战争添加WEB-INF / jboss-deployment-structure.xml文件:

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