0

我有麻煩了!我試圖通過IntelliJ IDEA 11部署我的JBoss AS 7.1.1.Final應用和部署的過程中我有這樣的例外:ClassNotFound異常中的異常

12:23:42,566 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."kladr.ear"."kladr-ejb-1.0-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."kladr.ear"."kladr-ejb-1.0-SNAPSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "kladr-ejb-1.0-SNAPSHOT.jar" of deployment "kladr.ear" 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_37] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_37] 
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_37] 
Caused by: java.lang.RuntimeException: Error getting reflective information for class com.kmware.ttk.kladr.dao.KladrUpdateDAO with ClassLoader ModuleClassLoader for Module "deployment.kladr.ear.kladr-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader 
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
Caused by: java.lang.NoClassDefFoundError: com/linuxense/javadbf/DBFException 
    at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_37] 
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_37] 
    at java.lang.Class.getDeclaredMethods(Class.java:1791) [rt.jar:1.6.0_37] 
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    ... 10 more 
Caused by: java.lang.ClassNotFoundException: com.linuxense.javadbf.DBFException from [Module "deployment.kladr.ear.kladr-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader] 
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) 
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) 
    ... 15 more 

這個庫linuxensepom.xml呈現。我不知道這個錯誤的原因。以下是pom的一部分:

.... 
    <dependency> 
      <groupId>com.linuxense</groupId> 
      <artifactId>javadbf</artifactId> 
      <version>0.4.0</version> 
    </dependency> 
.... 

應用程序正在EAR存檔中進行部署。 EAR包含EJB.jar和WEB.war應用程序(名稱不同)。

這可能是什麼原因?

+0

帶有EJB的JAR是否包含linuxense jar?或者EJB本身?你所展示的'pom.xml'部分是EJB的'pom.xml',WAR的''pom.xml'還是父'pom.xml'? – mthmulders

+0

pom的一部分是EJB的pom.xml。我把linuxense.jar手動添加到ejb.jar,它工作正常,但我不明白爲什麼它不會自動放在那裏? –

+0

你的EJB的pom.xml中的''是什麼? – mthmulders

回答

3

您的ClassNotFoundException是由linuxense jar在部署中不存在引起的。看看this question可能的解決方法。

+0

非常感謝。真的很有幫助。 –