0

I am trying to reproduce the test described in the Arquillian guide [1]. I was able to build the arquillian-was-embedded-8 from the source code as indicated here [2], however when running the test project using "mvn test" I get the following exception:

Enterprise JavaBeans (EJB) module does not have any enterprise beans configured. I include the full trace below.

Anyone able to shed some light here?

[1] http://arquillian.org/guides/getting_started/

[2] https://developer.jboss.org/message/851222#851222


Running org.arquillian.example.GreeterTest
3e7ee07e-9d99-45a7-a2f9-5d8c934f7c49.jar:
/org/
/org/arquillian/
/org/arquillian/example/
/org/arquillian/example/Greeter.class
/META-INF/
/META-INF/beans.xml
CNTR9269W: The 3e7ee07e-9d99-45a7-a2f9-5d8c934f7c49.jar Enterprise     JavaBeans (EJB) module does not have any enterprise beans configured.
WSVR0040E: addEjbModule failed for 3e7ee07e-9d99-45a7-a2f9-5d8c934f7c49.jar
com.ibm.ejs.container.EJBConfigurationException: The 3e7ee07e-9d99-45a7- a2f9-5d8c934f7c49.jar Enterprise JavaBeans (EJB) module does not have any  enterprise beans configured.
at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:747)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.startModules(EmbeddableContainer.java:965)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.start(EmbeddableContainer.java:922)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.open(EmbeddableContainer.java:429)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.newContainer(EmbeddableContainer.java:382)
at com.ibm.websphere.ejbcontainer.EmbeddableContainerProvider.createEJBContainer(EmbeddableContainerProvider.java:75)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at org.jboss.arquillian.container.was.embedded_8.WebSphereEmbeddedContainer.deploy(WebSphereEmbeddedContainer.java:126)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

UPDATE:

The problems seems to be now during the deployment of the created jar that contains the test classes. See trace below:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.arquillian.example.GreeterTest
28.08.2015 08:50:45    
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer setup
FEINER: ENTRY
28.08.2015 08:50:45   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer setup
FEINER: RETURN
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer start
FEINER: ENTRY
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
findVirtualMachineIdByName
FEINER: ENTRY
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: 
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD id: 4232
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: 
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD id: 6000
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
findVirtualMachineIdByName
FEINER: VMD displayName: org.codehaus.plexus.classworlds.launcher.Launcher - 
B test
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer    
findVirtualMachineIdByName
FEINER: VMD id: 3768
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: C:\Users\UDVT0160\workspace-tests\arquillian-  
test\target\surefire\surefirebooter5761378801456940119.jar    
C:\Users\UDVT0160\workspace-tests\arquillian- 
test\target\surefire\surefire4408666051028541749tmp  
C:\Users\UDVT0160\workspace-tests\arquillian-
test\target\surefire\surefire_05431784421594739159tmp
28.08.2015 08:50:45 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
findVirtualMachineIdByName
FEINER: VMD id: 6608
28.08.2015 08:50:45   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: org.codehaus.plexus.classworlds.launcher.Launcher -   
B test
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
findVirtualMachineIdByName
FEINER: VMD id: 3304
28.08.2015 08:50:45   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
findVirtualMachineIdByName
FEINER: RETURN
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer start
FEINER: Starting server with command: [C:\Program   
Files\Java\jdk1.6.0_33\jre/bin/java, -javaagent:lib/bootstrap-agent.jar, -  
jar, lib/ws-launch.jar, defaultServer]
Start von defaultServer (WebSphere Application Server 8.5.5.6/wlp-  
1.0.9.cl50620150610-1749) auf Java HotSpot(TM) 64-Bit Server VM, Version   
1.6.0_33-b05 (de_AT)
[AUDIT   ] CWWKE0001I: Der Server defaultServer wurde gestartet.
[AUDIT   ] CWWKE0100I: Dieses Produkt ist für den Entwicklungseinsatz und     
einen beschränkten Produktionseinsatz lizenziert. Die vollständigen   
Lizenzbedingungen finden Sie unter https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/8.5.5.6/lafiles/de.html.
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
findVirtualMachineIdByName
FEINER: ENTRY
28.08.2015 08:50:45   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: 
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD id: 4232
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
findVirtualMachineIdByName
FEINER: VMD displayName: 
28.08.2015 08:50:45   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
findVirtualMachineIdByName
FEINER: VMD id: 6000
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD displayName: lib/ws-launch.jar defaultServer
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: VMD id: 5028
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
findVirtualMachineIdByName
FEINER: RETURN 5028
28.08.2015 08:50:45  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
getVMLocalConnectorAddress
FEINER: service url: null
28.08.2015 08:50:46  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
getVMLocalConnectorAddress
FEINER: service url: null
[AUDIT   ] CWWKF0012I: Im Server wurden die folgenden Features installiert:   
[localConnector-1.0].
[AUDIT   ] CWWKF0011I: Der Server defaultServer ist bereit.
28.08.2015 08:50:46  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
getVMLocalConnectorAddress
FEINER: service url: service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc0AAtVbmljYXN0UmVmMgAACTEyNy4wLjAuMQAAwtGrL8n4ssEkwqzPIBMAAAFPcxKol4ABAHg=
28.08.2015 08:50:46   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer start
FEINER: vmid: 5028
28.08.2015 08:50:46   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer start
FEINER: RETURN
58a96136-072f-49a0-91b2-a88e6246b725.jar:
/META-INF/
/META-INF/beans.xml
/org/
/org/arquillian/
/org/arquillian/example/
/org/arquillian/example/Greeter.class
28.08.2015 08:50:47  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
getDefaultProtocol
FEINER: ENTRY
28.08.2015 08:50:47   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
getDefaultProtocol
FEINER: RETURN Servlet 3.0
28.08.2015 08:50:47  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
deploy
FEINER: ENTRY
28.08.2015 08:50:47 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
deploy
FEINER: Archive provided to deploy method: test.war:
/WEB-INF/
/WEB-INF/lib/
/WEB-INF/lib/58a96136-072f-49a0-91b2-a88e6246b725.jar
/WEB-INF/lib/arquillian-testenricher-ejb.jar
/WEB-INF/lib/arquillian-protocol.jar
/WEB-INF/lib/arquillian-junit.jar
/WEB-INF/lib/arquillian-testenricher-resource.jar
/WEB-INF/lib/arquillian-testenricher-cdi.jar
/WEB-INF/lib/arquillian-core.jar
/WEB-INF/lib/arquillian-testenricher-initialcontext.jar
/WEB-INF/beans.xml
28.08.2015 08:50:47   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
getDropInDirectory
FEINER: dropInDir: C:/Users/UDVT0160/workspace-  
tests/wlp/usr/servers/defaultServer/dropins
28.08.2015 08:50:48  
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
waitForMBeanTargetState
FEINER: ENTRY
28.08.2015 08:51:08 
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer    
undeploy
FEINER: ENTRY
28.08.2015 08:51:08   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
getDropInDirectory
FEINER: dropInDir: C:/Users/UDVT0160/workspace-  
tests/wlp/usr/servers/defaultServer/dropins
28.08.2015 08:51:08    
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer  
waitForMBeanTargetState
FEINER: ENTRY
28.08.2015 08:51:08   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer   
waitForMBeanTargetState
FEINER: RETURN
28.08.2015 08:51:08   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer 
undeploy
FEINER: RETURN
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 23.5 sec <<<   
FAILURE!
org.arquillian.example.GreeterTest  Time elapsed: 23.499 sec  <<< ERROR!
org.jboss.arquillian.container.spi.client.container.DeploymentException:   
Exception while deploying application.
at org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer.deploy(WLPManagedContainer.java:315)

at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
 Caused by: org.jboss.arquillian.container.spi.client.container.DeploymentException: Exception while checking application state.
at org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer.waitForApplicationTargetState(WLPManagedContainer.java:565)
at org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer.deploy(WLPManagedContainer.java:301)
... 93 more
 Caused by: 
 org.jboss.arquillian.container.spi.client.container.DeploymentException:   
 Timeout while waiting for ApplicationMBean to reach targetState
at  org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer.waitForApplicationTargetState(WLPManagedContainer.java:548)
... 94 more

28.08.2015 08:51:08   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer stop
FEINER: ENTRY
28.08.2015 08:51:08   
org.jboss.arquillian.container.was.wlp_managed_8_5.WLPManagedContainer stop
FEINER: RETURN
narko
  • 3,645
  • 1
  • 28
  • 33
  • Container thinks that you are trying to add ejb module and you have no ejb in there. Try to add `@Stateless` to your `Greeter` class. – Gas Aug 19 '15 at 16:37
  • I did try that already but then maven complains that Stateless is not known when running the test. Could it be a problem when building the was-embedded-8 jar? Did you also have to add @Stateless to the Greeter class after building the was-embedded jar from the source code? – narko Aug 19 '15 at 19:18
  • It complains as you probably dont have WebSphere runtime in the pom, so it cannot find Stateless annotation. I didn't build was-embedded, I used WebSphere Liberty lately, and some time ago - was-remote-8.5 (but that wasn't straight forward either). – Gas Aug 19 '15 at 20:10
  • Could you please share here your pom with the WebSphere dependencies that you use? It would help me a lot. Thanks! – narko Aug 20 '15 at 06:34
  • I tried again adding the @Stateless annotation to Greeter.java and now I get a NPE when running the test with maven. The problem is the same as described in [1], the difference is that I am using WAS. It seems to me that Arquillian is still quite unstable... [1] https://developer.jboss.org/thread/233894?start=0&tstart=0 – narko Aug 20 '15 at 07:49

2 Answers2

2

So here are pieces of my relevant files. But it is for Liberty not full WAS, so might be not so useful for you. However you should be able to test probably most of your app (depending on features that you use on Liberty and then deploy to classic WAS).

pom fragments:

repo:

<!-- Configure WASdev repository -->
<repositories>
    <repository>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
        </snapshots>
        <id>ibm-maven-repo</id>
        <name>ibm-maven-repo</name>
        <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>ibm-maven-repo</id>
        <name>ibm-maven-repo</name>
        <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

dependencies:

<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>1.1.8.Final</version>
        <scope>import</scope>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>com.ibm.tools.target</groupId>
        <artifactId>was-liberty</artifactId>
        <version>LATEST</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>
    <dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <!-- Arquillian WebSphere Liberty Profile support -->
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-wlp-managed-8.5</artifactId>
        <version>1.0.0.Alpha2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        <scope>test</scope>
    </dependency>   

arquillian.xml

<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <engine>
        <property name="deploymentExportPath">target/</property>
    </engine>

    <container qualifier="wlp-managed-85" default="true">
        <configuration>
            <property name="wlpHome">C:/IBM/WebSphere/wlp</property>
            <property name="serverName">defaultServer</property>
            <property name="httpPort">9080</property>
            <property name="appDeployTimeout">20</property>
            <property name="appUndeployTimeout">20</property>
        </configuration>
    </container>
</arquillian>

test class (it is for testing ejb that is inside of web project, so you may need to change that):

@RunWith(Arquillian.class)
public class HelloBeanTest {
@EJB HelloBean bean;

@Test
public void helloTest() {
    assertNotNull(bean);

    assertEquals("hello", bean.hello());
}

@Deployment
public static WebArchive createDeployment() {

    final File[] libs = Maven.resolver().loadPomFromFile("pom.xml").importDependencies(ScopeType.COMPILE, ScopeType.TEST).resolve()
            .withTransitivity().asFile();

    WebArchive archive =  ShrinkWrap.create(WebArchive.class)

            .addPackages(true, "pkg1")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File("WebContent/WEB-INF/web.xml"), "web.xml")
            .addAsLibraries(libs);

    System.out.println(archive.toString(true));
    return archive;
  }
}

server.xml

<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>jdbc-4.0</feature>
        <feature>jsf-2.0</feature>
        <feature>jaxrs-1.1</feature>
        <feature>cdi-1.0</feature>
        <feature>ejbLite-3.1</feature>
        <feature>jpa-2.0</feature>
        <feature>servlet-3.1</feature>
    </featureManager>

    <!-- To access this server from a remote client add a host attribute to 
        the following element, e.g. host="*" -->
    <httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
    <dataSource jndiName="jdbc/myDataSource">
        <jdbcDriver>
            <library name="derbyLibrary">
                <fileset dir="${server.config.dir}/resources/derby"/>
            </library>
        </jdbcDriver>
        <properties.derby.embedded createDatabase="create" databaseName="db1"/>
    </dataSource>
    <applicationMonitor updateTrigger="mbean"/>
    <webApplication contextRoot="myapp" id="myapp" location="myapp.war" name="myapp"/>
</server>
Gas
  • 17,601
  • 4
  • 46
  • 93
  • Alright, I think I am very close now after using the same configuration than you. Can you please let me know which JRE version you are using? Still having issues during the server startup... – narko Aug 20 '15 at 14:41
  • @narko I've used JDK 1.7. But if you are trying classic WebSphere you will need to use 1.6 java provided with WebSphere. – Gas Aug 20 '15 at 15:56
  • Thanks a lot for the info. Still not working though... I have tried in two different machines (Windows and Mac OS X) and now having the following problem during deployment. org.jboss.arquillian.container.spi.client.container.DeploymentException: Exception while deploying application. Caused by: org.jboss.arquillian.container.spi.client.container.DeploymentException: Exception while checking application state. – narko Aug 28 '15 at 06:53
  • Which config do you use in your server.xml file? Thanks! – narko Aug 28 '15 at 06:55
  • @narko I've added server.xml, but it shouldnt really matter. Are you sure your server was not already started? If I remember correctly the aqruillian test is FIRST starting the server, then deploys app, do testing, and stops server. If server is already started then it fails. – Gas Aug 28 '15 at 08:41
  • @narko Could you add full stack trace to the question? – Gas Aug 28 '15 at 08:53
  • thanks for the answer. I don't run my server manually, arquillian does it for me as can be seen in the trace. I am attaching the full trace together with log messages in a different post. – narko Aug 28 '15 at 09:58
  • @narko try to increase `appDeployTimeout` for example to 120 and see what happens. – Gas Aug 28 '15 at 10:29
  • Same issue independently of the **appDeployTimeout**: Timeout while waiting for ApplicationMBean to reach targetState. Is there any place where I should configure such MBean? – narko Aug 28 '15 at 11:05
  • @narko I'm out of ideas... A local firewall maybe? – Gas Aug 28 '15 at 12:28
  • I thought the same while retrieving the maven dependencies, but then I tried in a different computer with a different network and still the same issue... I will try replacing was with tomcat and see if the problem still exits... – narko Aug 28 '15 at 16:42
  • @narko are you still using that compiled code, or you had switched to the dependency and config I provided? – Gas Aug 28 '15 at 17:22
  • I am getting all the dependencies from the respective maven repositories. The only library I am using from the source code is *arquillian-wlp-managed-8.5* because it is not publicly available in any maven repository. For the rest, I am using the same configuration that you shared here. I also installed the ibm tools for managing was with eclipse luna. – narko Aug 28 '15 at 18:42
  • @narko I found it for example here - http://mvnrepository.com/artifact/org.jboss.arquillian.container/arquillian-wlp-managed-85/1.0.0.Alpha1 , so maybe try the prebuild jar version – Gas Aug 28 '15 at 21:16
  • @narko - you may also try this [tutorial](https://developer.ibm.com/wasdev/docs/getting-started-liberty-arquillian/) – Gas Aug 28 '15 at 21:19
  • Thanks! With the alpha1 version I get the following problem: org.arquillian.example.GreeterTest Time elapsed: 0.318 sec <<< ERROR! java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor Caused by: java.lang.NoSuchMethodError: org.jboss.shrinkwrap.descriptor.api.DescriptorImporter.fromStream(Ljava/io/InputStream;)Lorg/jboss/shrinkwrap/descriptor/api/Descriptor; at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.resolveDescriptor(ConfigurationRegistrar.java:70) – narko Aug 28 '15 at 21:49
  • I could make the [arquillian-tutorial](https://github.com/arquillian/arquillian-examples/tree/master/arquillian-tutorial) work with arquillian-weld-ee-embedded-1.1. I am still getting the same problem as reported earlier while deploying with the liberty server :( – narko Aug 31 '15 at 09:44
  • I also got it working for jboss-as-7.1.1-Final. This means there is something wrong with my was liberty... – narko Aug 31 '15 at 14:00
0

Oh yeah!!! I got it working with wlp. I guess it was a configuration problem. I downloaded the was liberty v8.5.5.6 Runtime available here. Note that at the beginning I was using WAS Liberty with Java EE 7 Full Platform, which is available [here] (https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/).

I installed it locally running the jar with the following command: java -jar wlp-runtime-8.5.5.6.jar Finally, I created a new server on eclipse using that location. I configured a defaultServer using the following config:

<!-- Enable features -->
<featureManager>
    <feature>jsp-2.2</feature>
    <feature>localConnector-1.0</feature>
    <feature>cdi-1.0</feature>
    <feature>ejbLite-3.1</feature>
</featureManager>

<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
              host="localhost"
              httpPort="9080"
              httpsPort="9443" />

My arquillian.xml file (placed in src/test/resources in my eclipse project) is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
    http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<engine>
    <property name="deploymentExportPath">target/</property>
</engine>

<container qualifier="wlp" default="true">
    <configuration>
        <property name="wlpHome">C:\Users\UDVT0160\Downloads\wlp</property>
        <property name="serverName">defaultServer</property>
        <property name="httpPort">9080</property>
        <property name="appDeployTimeout">10</property>
        <property name="appUndeployTimeout">10</property>
    </configuration>
</container>

I will soon post a step by step tutorial to help others. Thanks a billion @Gas for your valuable support!

narko
  • 3,645
  • 1
  • 28
  • 33