2 Replies Latest reply on Sep 29, 2013 11:23 AM by echiphn

    Problem running JSFUnit 2.0.0.Beta2 Getting Started example on JBoss AS7.1.1Final

    mwoinoskibt

      I'm new to JSFUnit (and JBoss and Arquillian and ...), and I'm having a problem running the JSFUnit 2.0.0.Beta2 Getting Started example. I installed JBoss AS7.1.1Final on Windows 7 and started JBoss using bin/standalone.bat. I can login to the jboss admin console and deploy a simple war file, so the server is functional. I downloaded gettingstarted.jar from the Getting Started page, extracted it and ran "mvn -Pjbossas-remote-7 test". The test fails with "java.net.ConnectException: Could not connect to remote://127.0.0.1:9999 in 5000ms." Test output is included below.

       

      I can use bin/jboss-cli.bat to connect to localhost:9999 and deploy a war file. I made sure my firewall config enables access to ports 9990-9999. As suggested in the error message, I tried setting a longer timeout in org.jboss.as.client.connect.timeout but the results were the same.

       

      There's nothing in the JSFUnit Getting Started page about where to set the JBoss admin username and password for deploying the app. Do the credentials need to be configured somewhere? I added a username and password property to the <engine> element in arquillian.xml but got the same error.

       

      Also, when the tests start to run, there's a message from arquillian about a missing container config:

           Running org.jboss.jsfunit.example.hellojsf.HelloJSFTest

           ... org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator getActivatedConfiguration

           INFO: Could not read active container configuration: null

      Do I need to add something to the arquillian.xml included in the gettingstarted project?

           <arquillian ...>

                <engine>

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

                </engine>

                <defaultProtocol type="Servlet 3.0" />

           </arquillian>

       

      Thanks,

      Mike

       

      -------------------------------------------------------------------------------

      Test set: org.jboss.jsfunit.example.hellojsf.HelloJSFTest

      -------------------------------------------------------------------------------

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.74 sec <<< FAILURE!

      org.jboss.jsfunit.example.hellojsf.HelloJSFTest  Time elapsed: 0 sec  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy to container

                at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:58)

                at org.jboss.as.arquillian.container.CommonDeployableContainer.deploy(CommonDeployableContainer.java:96)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:148)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:258)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)

                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:90)

                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: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:90)

                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:90)

                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: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:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:250)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:226)

                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.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:90)

                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:134)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:97)

                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:90)

                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:68)

                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:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)

                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:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:158)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)

                at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)

                at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)

                at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)

                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.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)

                at $Proxy0.invoke(Unknown Source)

                at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)

                at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)

                at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

      Caused by: java.util.concurrent.ExecutionException: Operation failed

                at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)

                at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)

                at org.jboss.as.controller.client.impl.AbstractModelControllerClient$DelegatingCancellableAsyncFuture.get(AbstractModelControllerClient.java:413)

                at org.jboss.as.controller.client.impl.AbstractModelControllerClient$DelegatingCancellableAsyncFuture.get(AbstractModelControllerClient.java:365)

                at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:69)

                at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:42)

                at org.jboss.as.arquillian.container.ArchiveDeployer.executeDeploymentPlan(ArchiveDeployer.java:75)

                at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:56)

                ... 94 more

      Caused by: java.net.ConnectException: Could not connect to remote://127.0.0.1:9999 in 5000ms. Make sure the server is running and/or consider setting a longer timeout by setting -Dorg.jboss.as.client.connect.timeout=<timeout in ms>.

                at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:128)

                at org.jboss.as.protocol.mgmt.ManagementRequest$1.run(ManagementRequest.java:101)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:619)

        • 1. Re: Problem running JSFUnit 2.0.0.Beta2 Getting Started example on JBoss AS7.1.1Final
          mwoinoskibt

          I got this working by changing changing and adding dependencies in the Getting Started project's pom.xml. Here's a version that works with JBoss AS 7.1.1.Final:

           

          <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

           

              <modelVersion>4.0.0</modelVersion>

           

              <groupId>org.jboss.jsfunit</groupId>

              <artifactId>gettingstarted</artifactId>

              <version>2.0.0.Beta2</version>

              <packaging>war</packaging>

              <name>Minimal example for the Getting Started Guide</name>

           

              <repositories>

                  <repository>

                      <id>jboss-public-repository-group</id>

                      <name>JBoss Public Maven Repository Group</name>

                      <url>https://repository.jboss.org/nexus/content/groups/public</url>

                      <layout>default</layout>

                      <releases>

                          <enabled>true</enabled>

                          <updatePolicy>never</updatePolicy>

                      </releases>

                      <snapshots>

                          <enabled>true</enabled>

                          <updatePolicy>never</updatePolicy>

                      </snapshots>

                  </repository>

              </repositories>

              <pluginRepositories>

                  <pluginRepository>

                      <id>jboss-public-repository-group</id>

                      <name>JBoss Public Repository Group</name>

                      <url>http://repository.jboss.org/nexus/content/groups/public/</url>

                      <releases>

                          <enabled>true</enabled>

                      </releases>

                      <snapshots>

                          <enabled>true</enabled>

                      </snapshots>

                  </pluginRepository>

              </pluginRepositories>

           

              <properties>

                  <version.jsfunit>2.0.0.Beta2</version.jsfunit>

                  <version.arquillian>1.0.0.Final</version.arquillian>

                  <version.arquillian.jboss>1.0.0.Final</version.arquillian.jboss>

                  <version.shrinkwrap>1.0.0</version.shrinkwrap>

                  <version.shrinkwrap.descriptors>1.1.0-beta-1</version.shrinkwrap.descriptors>

                  <version.shrinkwrap.resolvers>1.0.0-beta-5</version.shrinkwrap.resolvers>

                  <version.jboss_60>6.0.0.Final</version.jboss_60>

                  <version.jboss_7>7.1.1.Final</version.jboss_7>

              </properties>

           

              <!-- Dependencies common to all containers -->

              <dependencies>

                  <dependency>

                      <groupId>junit</groupId>

                      <artifactId>junit</artifactId>

                      <version>4.8.2</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.arquillian.junit</groupId>

                      <artifactId>arquillian-junit-container</artifactId>

                      <version>${version.arquillian}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.arquillian.protocol</groupId>

                      <artifactId>arquillian-protocol-servlet</artifactId>

                      <version>${version.arquillian}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.arquillian.container</groupId>

                      <artifactId>arquillian-container-spi</artifactId>

                      <version>${version.arquillian}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.arquillian.testenricher</groupId>

                      <artifactId>arquillian-testenricher-cdi</artifactId>

                      <version>${version.arquillian}</version>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.spec.javax.faces</groupId>

                      <artifactId>jboss-jsf-api_2.1_spec</artifactId>

                      <version>2.0.0.Beta1</version>

                      <scope>provided</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.spec.javax.servlet</groupId>

                      <artifactId>jboss-servlet-api_3.0_spec</artifactId>

                      <version>1.0.0.Final</version>

                      <scope>provided</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.jsfunit</groupId>

                      <artifactId>jsfunit-arquillian</artifactId>

                      <version>${version.jsfunit}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.jsfunit</groupId>

                      <artifactId>jboss-jsfunit-core</artifactId>

                      <version>${version.jsfunit}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.shrinkwrap.descriptors</groupId>

                      <artifactId>shrinkwrap-descriptors-impl</artifactId>

                      <version>${version.shrinkwrap.descriptors}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.shrinkwrap.resolver</groupId>

                      <artifactId>shrinkwrap-resolver-api-maven</artifactId>

                      <version>${version.shrinkwrap.resolvers}</version>

                      <scope>test</scope>

                  </dependency>

           

                  <dependency>

                      <groupId>org.jboss.shrinkwrap.resolver</groupId>

                      <artifactId>shrinkwrap-resolver-impl-maven</artifactId>

                      <version>${version.shrinkwrap.resolvers}</version>

                      <scope>test</scope>

                  </dependency>

           

              </dependencies>

           

              <profiles>

                  <profile>

                      <id>jbossas-remote-6</id>

                      <dependencies>

                          <dependency>

                              <groupId>org.jboss.arquillian.container</groupId>

                              <artifactId>arquillian-jbossas-remote-6</artifactId>

                              <version>${version.arquillian.jboss}</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.jboss.jbossas</groupId>

                              <artifactId>jboss-as-profileservice-client</artifactId>

                              <version>${version.jboss_60}</version>

                              <type>pom</type>

                          </dependency>

                      </dependencies>

                  </profile>

           

                  <profile>

                      <id>jbossas-remote-7</id>

                      <dependencies>

                          <dependency>

                              <groupId>org.jboss.spec</groupId>

                              <artifactId>jboss-javaee-6.0</artifactId>

                              <version>1.0.0.Final</version>

                              <type>pom</type>

                              <scope>provided</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.jboss.as</groupId>

                              <artifactId>jboss-as-arquillian-container-remote</artifactId>

                              <version>${version.jboss_7}</version>

                              <scope>test</scope>

                          </dependency>

                      </dependencies>

                  </profile>

           

               </profiles>

          </project>

           

          • 2. Re: Problem running JSFUnit 2.0.0.Beta2 Getting Started example on JBoss AS7.1.1Final

            that really helps me so much to find the correct version of all dependencies. thanks so much