运行部署在JBOSS 6.2上的应用程序时出现java.lang.LinkageError

时间:2014-06-12 10:41:37

标签: java scala deployment jboss jboss-eap-6

尝试访问我的应用的登录页面时,会显示以下错误。 一些细节:

  1. 应用程序使用Scala Lift框架。
  2. JBOSS 6.2.0 EAP。
  3. 部署的上下文根是/ cpt
  4. 可能的原因是什么?谢谢!

     Message: java.lang.LinkageError: Failed to link 
    de/o2/bic/cpt/web/lift/snippet/Loginform 
    (Module "deployment.cpt.war:main" from Service Module Loader)
        org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:428)
        org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)
        org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)
        org.jboss.modules.Module.loadModuleClass(Module.java:548)
        org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:189)
        org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443)
        org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431)
        org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373)
        org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Class.java:186)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3$$anonfun$apply$4.apply(ClassHelpers.scala:58)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3$$anonfun$apply$4.apply(ClassHelpers.scala:58)
        net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:46)
        net.liftweb.util.Helpers$.tryo(Helpers.scala:34)
        net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:109)
        net.liftweb.util.Helpers$.tryo(Helpers.scala:34)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3.apply(ClassHelpers.scala:58)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3.apply(ClassHelpers.scala:55)
        scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
        scala.collection.Iterator$class.toStream(Iterator.scala:1024)
        scala.collection.Iterator$$anon$21.toStream(Iterator.scala:368)
        scala.collection.IterableLike$class.toStream(IterableLike.scala:284)
        scala.collection.SeqViewLike$$anon$4.toStream(SeqViewLike.scala:78)
        scala.collection.TraversableLike$class.toIterator(TraversableLike.scala:570)
        scala.collection.SeqViewLike$$anon$4.toIterator(SeqViewLike.scala:78)
        scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
        scala.collection.Iterator$class.foreach(Iterator.scala:660)
        scala.collection.Iterator$$anon$21.foreach(Iterator.scala:368)
        scala.collection.IterableViewLike$Transformed$class.foreach(IterableViewLike.scala:41)
        scala.collection.SeqViewLike$$anon$4.foreach(SeqViewLike.scala:78)
        scala.collection.TraversableViewLike$Transformed$class.headOption(TraversableViewLike.scala:89)
        scala.collection.SeqViewLike$$anon$4.headOption(SeqViewLike.scala:78)
        net.liftweb.util.ClassHelpers$class.findClass(ClassHelpers.scala:59)
        net.liftweb.util.Helpers$.findClass(Helpers.scala:34)
        net.liftweb.util.ClassHelpers$class.findType(ClassHelpers.scala:74)
        net.liftweb.util.Helpers$.findType(Helpers.scala:34)
        net.liftweb.util.ClassHelpers$class.findClass(ClassHelpers.scala:88)
        net.liftweb.util.Helpers$.findClass(Helpers.scala:34)
        net.liftweb.util.ClassHelpers$class.findClass(ClassHelpers.scala:126)
        net.liftweb.util.Helpers$.findClass(Helpers.scala:34)
        net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$findSnippetClass(LiftSession.scala:1253)
        net.liftweb.http.LiftSession$$anonfun$net$liftweb$http$LiftSession$$findSnippetInstance$1$$anonfun$apply$64.apply(LiftSession.scala:1390)
        net.liftweb.http.LiftSession$$anonfun$net$liftweb$http$LiftSession$$findSnippetInstance$1$$anonfun$apply$64.apply(LiftSession.scala:1390)
        net.liftweb.common.EmptyBox.or(Box.scala:576)
        net.liftweb.http.LiftSession$$anonfun$net$liftweb$http$LiftSession$$findSnippetInstance$1.apply(LiftSession.scala:1389)
        net.liftweb.http.LiftSession$$anonfun$net$liftweb$http$LiftSession$$findSnippetInstance$1.apply(LiftSession.scala:1389)
        net.liftweb.common.EmptyBox.or(Box.scala:576)
        net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$findSnippetInstance(LiftSession.scala:1388)
        net.liftweb.http.LiftSession$$anonfun$locateAndCacheSnippet$1$1$$anonfun$apply$78.apply(LiftSession.scala:1543)
        ...      
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
        org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
        org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
        java.lang.Thread.run(Thread.java:722)
    
    Caught and thrown by:
    Message: java.lang.NoClassDefFoundError: de/o2/bic/cpt/web/lift/snippet/Loginform (wrong name: de/o2/bic/cpt/web/lift/snippet/loginform)
        java.lang.ClassLoader.defineClass1(Native Method)
        java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:345)
        org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:423)
        org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)
        org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)
        org.jboss.modules.Module.loadModuleClass(Module.java:548)
        org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:189)
        org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443)
        org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431)
        org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373)
        org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Class.java:186)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3$$anonfun$apply$4.apply(ClassHelpers.scala:58)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3$$anonfun$apply$4.apply(ClassHelpers.scala:58)
        net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:46)
        net.liftweb.util.Helpers$.tryo(Helpers.scala:34)
        net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:109)
        net.liftweb.util.Helpers$.tryo(Helpers.scala:34)
        net.liftweb.util.ClassHelpers$$anonfun$findClass$1$$anonfun$apply$3.apply(ClassHelpers.scala:58)
        ...
        org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
        org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
        java.lang.Thread.run(Thread.java:722)
    

2 个答案:

答案 0 :(得分:0)

还没有回答。我们遇到与JBoss EAP 6.2(LinkageError,NoClassDefFoundError,ClassNotFoundError)类似的错误,但还没有找到解决方案。我们怀疑“新”模块化类加载器中的错误。

答案 1 :(得分:0)

TL; DR - 尝试重建没有依赖项的项目,一次一个 - 尤其是log4j。

答案是在JBOSS如何加载库的过程中。如果它遇到已经作为服务器库的项目库,则类加载器会中断。通常它是由logger log4j lib。因此,尝试删除此依赖项并使用备用记录器。当然,这也需要你改变代码。

至少,这就是我们的情况。