我是JBoss的新手。 WAS上有一個Ear文件可以工作。但是當我在JBoss EAP 7.1上嘗試時,它給了我下面的錯誤。jboss未能定義類javax.jms.JMSException
14:15:18,640 WARN [org.jboss.modules] (MSC service thread 1-6) Failed to define class javax.jms.JMSException in Module "deployment.xxx.ear.yyy.war:mai
n" from Service Module Loader: java.lang.ClassFormatError: Failed to link javax/jms/JMSException (Module "xxx.ear.yyy.war:main" from Service
Module Loader): Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:605)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.jboss.as.jsf.deployment.JSFManagedBeanProcessor.deploy(JSFManagedBeanProcessor.java:100)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
14:15:18,640 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.subunit."xxx.ear"."yyy.war
".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."xxx.ear"."yyy.war".POST_MODULE: WFLYSRV0153: Failed to process
phase POST_MODULE of subdeployment "yyy.war" of deployment "xxx.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Failed to link javax/jms/JMSException (Module "deployment.xxx.ear.yyy.war:main" from Service Module Loader): Abs
ent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:605)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.jboss.as.jsf.deployment.JSFManagedBeanProcessor.deploy(JSFManagedBeanProcessor.java:100)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
從研究,它似乎只是接口的依賴問題。
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
所以我改成
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0-5</version>
</dependency>
,但沒有運氣。我也在尋找像j2ee.jar這樣的jar。我可以在JBoss運行時找到一個jboss-ejb-api_3.2_spec-1.0.0.Final-redhat-1.jar。但它不包含任何關於javax.jms。*的內容。
另外我看了一堂課。使用帶有內容的jboss-deployment-structure.xml修補ear文件以消除雙重類加載。
<jboss-deployment-structure>
<ear-subdeployments-isolated>true</ear-subdeployments-isolated>
</jboss-deployment-structure>
仍然不起作用。有什麼建議麼?
你真的在使用2天的JBoss EAP 7.1 Alpha版嗎? –
更改爲EAP 7.0。同樣的錯誤。 – rickcoup