2016-08-19 191 views
1

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

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

"{\"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“杰里科HTML-2.6.1.jar”。为此,我添加了$ {wildfly_home}/modules/system/layers/base/au/id/jericho/lib/html/main jericho-html-2.6.1.jar和this 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"/> 

扩展,但我得到同样的错误。

+0

认为你应该使用'杰里科的HTML 2.6.1.jar'。没有'-sources'。 – Jens

+0

嗨@Jens,我尝试过但不工作。我如何验证jericho模块已加载? –

回答

2

为什么要在standalone.xml中添加扩展? 您应该添加一个WEB-INF/jboss的部署,structure.xml文件到你的战争与:

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

我认为我需要在standalone.xml中添加扩展。 我知道你说的和在文件pom中添加库相同。我试图在不触及我的战争的情况下部署应用程序。 –

+0

你可以使用叠加层来实现:https://docs.jboss.org/author/display/WFLY8/Deployment+Overlays这是一种在战争中添加/替换文件而不实际修改它的方法 – ehsavoie

相关问题