java.lang.NoSuchFieldError: ENVIRONMENT when run as a client
iapazmino Nov 24, 2012 9:14 PMHello,
Right now I need my (war) deployment to be enriched to get access to the persistence context and setup the database, and then, run the test as a client to check some auto-loaded content. To do so, I've made the deployment testable and marked the test to run as a client
@Deployment public static WebArchive createDeployable() { final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war") ... .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsWebInfResource( new StringAsset("<faces-config version=\"2.0\"/>"), "faces-config.xml"); return war; } @Test @RunAsClient public void shouldAutoLoadDestinataries() { ... assertEquals(SUBJECT, browser.getValue("id=agreementForm:subject")); }
This causes the following exception during deployment
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit.arquillian-service.INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit.arquillian-service.INSTALL: Failed to process phase INSTALL of deployment "arquillian-service" 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_31] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31] Caused by: java.lang.NoSuchFieldError: ENVIRONMENT at org.jboss.as.arquillian.service.ArquillianService.addService(ArquillianService.java:88) at org.jboss.as.arquillian.service.ArquillianServiceActivator.activate(ArquillianServiceActivator.java:41) at org.jboss.as.server.deployment.service.ServiceActivatorProcessor.deploy(ServiceActivatorProcessor.java:62) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 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
If I remove the @RunAsClient annotation from the test and mark the @Deployment with (testable = false) the server starts but setup fails as the persistence components I need are not provided.
The boms I'm using are
<dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>1.0.3.Final</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.extension</groupId> <artifactId>arquillian-drone-bom</artifactId> <version>1.1.0.Final</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>7.1.2.Final</version> <scope>test</scope> </dependency>
Any ideas where the problems might be at?
Thanks in advance