4 Replies Latest reply: Apr 29, 2012 3:20 AM by Dan Allen RSS

'get_started_faster_with_forge' guide not working (Forge v1.0.0.Final)

Craig Schwarzwald Newbie

I attempted to go through the sample in (what I'm pretty sure is the official) guide for setting up arquillian with forge located:

https://github.com/arquillian/arquillian.github.com/blob/develop/guides/get_started_faster_with_forge.textile

 

I'm using Forge version 1.0.0.Final, and selecting all the defaults when any inputs are asked for by Forge on the steps within the guide.

 

Just a few commands to setup a new project, a sample bean, install the plugin, setup a test, and build... only I'm gettin an error on the build:

demo.MySimpleBeanTest: Could not create a new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor see cause.

 

Logs:

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

demo.MySimpleBeanTest  Time elapsed: 0 sec  <<< ERROR!

java.lang.RuntimeException: Could not create a new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor see cause.

    at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:170)

    at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)

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

    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.lang.reflect.InvocationTargetException

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

    at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:166)

    ... 14 more

Caused by: java.lang.RuntimeException: Could not create a new instance of class org.jboss.arquillian.core.impl.ManagerImpl see cause.

    at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:157)

    at org.jboss.arquillian.core.spi.ManagerBuilder.create(ManagerBuilder.java:77)

    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:55)

    ... 19 more

Caused by: java.lang.reflect.InvocationTargetException

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

    at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:153)

    ... 21 more

Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/test/spi/enricher/resource/ResourceProvider

    at org.jboss.as.arquillian.container.CommonContainerExtension.register(CommonContainerExtension.java:38)

    at org.jboss.as.arquillian.container.managed.ManagedContainerExtension.register(ManagedContainerExtension.java:33)

    at org.jboss.arquillian.core.impl.loadable.LoadableExtensionLoader.load(LoadableExtensionLoader.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.ManagerImpl.fireProcessing(ManagerImpl.java:315)

    at org.jboss.arquillian.core.impl.ManagerImpl.<init>(ManagerImpl.java:97)

    ... 26 more

Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider

    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

    at java.security.AccessController.doPrivileged(Native Method)

 

 

I tried adding the arquillian.xml file via forge: $ arquillian configure-container --profile JBOSS_AS_MANAGED_7.X  (step not in the guilde), but that yeilds the same error in the logs.

 

Can anyone help on this?

 

Thanks a lot.

  • 1. Re: 'get_started_faster_with_forge' guide not working (Forge v1.0.0.Final)
    Aslak Knutsen Master

    what does your pom look like at this point?

  • 2. Re: 'get_started_faster_with_forge' guide not working (Forge v1.0.0.Final)
    Craig Schwarzwald Newbie

    pom.xml:

    <?xml version="1.0" encoding="UTF-8"?>

    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <modelVersion>4.0.0</modelVersion>

      <groupId>demo</groupId>

      <artifactId>arquillian-demo</artifactId>

      <version>1.0.0-SNAPSHOT</version>

      <dependencyManagement>

        <dependencies>

          <dependency>

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

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

            <version>2.0.0.Final</version>

            <type>pom</type>

            <scope>import</scope>

          </dependency>

        </dependencies>

      </dependencyManagement>

      <dependencies>

        <dependency>

          <groupId>javax.enterprise</groupId>

          <artifactId>cdi-api</artifactId>

          <scope>provided</scope>

        </dependency>

        <dependency>

      <groupId>org.jboss.spec.javax.annotation</groupId>
      <artifactId>jboss-annotations-api_1.1_spec</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <version>1.0.0.Final-SNAPSHOT</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian</groupId>
      <artifactId>arquillian-bom</artifactId>
      <version>1.0.0.Final-SNAPSHOT</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>

      </dependencies>

      <repositories>

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

      </repositories>

      <build>

    <finalName>arquillian-demo</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
    </plugins>

      </build>

      <profiles>

    <profile>
      <id>JBOSS_AS_MANAGED_7.X</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>7.1.1.Final</version>
        </dependency>
      </dependencies>
    </profile>

      </profiles>

    </project>

     

    I used version 1.0.0.Final of Forge, so you should be able to recreate everything I did in just a couple of commands by following the guide if you need anything else.

     

    Thanks.

  • 3. Re: 'get_started_faster_with_forge' guide not working (Forge v1.0.0.Final)
    Aslak Knutsen Master

    I pushed a few changes to the plugin that should fix some of these problems. If you try to run on the latest plugin it should help.

     

    The remaining issues are:

     

    * if you choose to 'download/install the server' the arq.xml jbossHome is not setup to match your download location so you'll have to create that manually

    https://github.com/forge/plugin-arquillian/issues/10

     

    * Any arq.xml container-configuration you add are added to a non default contianer config if arq.xml, so you'll have to either set it as default manually or manually add a arquillian.launch system prop to the maven profile.

  • 4. Re: 'get_started_faster_with_forge' guide not working (Forge v1.0.0.Final)
    Dan Allen Master

    I also just did a major revision to the Get Started Faster with Forge Guide (only the English version). It should all be working now as expected (with the exception of jbossHome not being set in arquillian.xml if you selected to have the server downloaded and installed, as Aslak mentioned).

     

    If you have feedback, feel free to update the guide source and send a pull request.