我刚刚开始使用Maven作为构建系统。
使用: Java 1.6 Apache Maven 3.0.3 JBoss 7.1.1-final Eclipse Juno(虽然这可能与我在命令行上看到相同的失败无关)
我使用原型创建了一个新的mvn项目:jboss-javaee6-webapp-ear-blank-archetype
然后根据[Arquillian入门指南] [1]
添加了一些更改,以便使用Arquillian。我正在尝试编写无状态会话Bean的第一个测试。实际上测试什么也没做,确实测试代码甚至没有运行。
问题发生在mvn目标'process-test-classes'和'test'之间。基本上似乎maven生成并试图部署的test.war并没有正确地解决所有类,尽管事实上一切都很好。
由于我已经控制了Maven,我真的不知道为什么Maven不高兴或者如何解决它。
有关导致问题的原因或我如何开始诊断情况的任何想法? (-X选项提供了大量配置详细信息,但没有指向何处进行搜索)
为了完整性,这里是服务器和测试输出:
12:33:06,096 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory /usr/local/jboss-7.1.1-final/standalone/deployments
12:33:06,107 INFO [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /127.0.0.1:4447
12:33:06,108 INFO [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on /127.0.0.1:9999
12:33:06,266 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
12:33:06,266 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 3054ms - Started 138 of 214 services (74 services are passive or on-demand)dd/mc
12:33:11,052 INFO [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location /usr/local/jboss-7.1.1-final/standalone/data/content/e5/ae1c4f030493900cf7d3fb8d2ea98813c04966/content
12:33:11,065 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "test.war"
12:33:11,485 WARN [org.jboss.modules] (MSC service thread 1-1) Failed to define class dd.mc.database.access.SiteAccess in Module "deployment.test.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link dd/mc/database/access/SiteAccess (Module "deployment.test.war:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:517)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
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)
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_51]
at java.lang.Class.forName(Class.java:249) [classes.jar:1.6.0_51]
at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:63) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_51]
Caused by: java.lang.NoClassDefFoundError: dd/mc/database/access/SiteAccessLocal
at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_51]
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [classes.jar:1.6.0_51]
at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [classes.jar:1.6.0_51]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_51]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
... 20 more
Caused by: java.lang.ClassNotFoundException: dd.mc.database.access.SiteAccessLocal from [Module "deployment.test.war: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.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 26 more
12:33:11,507 WARN [org.jboss.modules] (MSC service thread 1-1) Failed to define class dd.mc.database.access.SiteAccess in Module "deployment.test.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link dd/mc/database/access/SiteAccess (Module "deployment.test.war:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:225)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:97)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [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:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_51]
Caused by: java.lang.NoClassDefFoundError: dd/mc/database/access/SiteAccessLocal
at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_51]
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [classes.jar:1.6.0_51]
at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [classes.jar:1.6.0_51]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_51]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]
... 16 more
Caused by: java.lang.ClassNotFoundException: dd.mc.database.access.SiteAccessLocal from [Module "deployment.test.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
... 22 more
12:33:11,528 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."test.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "test.war"
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:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_51]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Could not load EJB class dd.mc.database.access.SiteAccess
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:227)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:97)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: dd.mc.database.access.SiteAccess from [Module "deployment.test.war: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.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:225)
... 7 more
12:33:11,540 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "test.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"test.war\""}}
12:33:11,542 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."test.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "test.war"
12:33:11,574 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment test.war in 31ms
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.211 sec (WeldClassImpl.java:154) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
... 11 more
Caused by: java.lang.ClassNotFoundException: dd.mc.database.User from [Module "deployment.test.war: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)
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_51]
at java.lang.Class.forName(Class.java:249) [classes.jar:1.6.0_51]
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95) [classes.jar:1.6.0_51]
... 29 more
12:33:13,384 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /test
12:33:13,461 INFO [org.jboss.as.server] (management-handler-thread - 4) JBAS018559: Deployed "test.war"
12:33:14,101 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016009: Stopping weld service for deployment test.war
12:33:14,116 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment test.war in 62ms
12:33:14,161 INFO [org.jboss.as.repository] (management-handler-thread - 1) JBAS014901: Content removed from location /usr/local/jboss-7.1.1-final/standalone/data/content/00/85445003ed8a1c42f91054bf5010444853af82/content
12:33:14,162 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018558: Undeployed "test.war"
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.543 sec
答案 0 :(得分:0)
您似乎错过了将相关的类文件或jar添加到测试工件中。检查是否添加了所有工件。