1 Reply Latest reply: Apr 2, 2012 9:53 AM by José Freitas RSS

    Running EJB tests in Jboss 4.2.3

    José Freitas Newbie

      Hello Guys,

       

      I'm trying to run some ejb tests in a jboss 4.2.3 remote container.

       

      I created the following profile:

       

      <profile>
                     <id>jboss-remote-4_2</id>
                     <dependencies>
                         <dependency>
                             <groupId>org.jboss.arquillian.container</groupId>
                          <artifactId>arquillian-jbossas-remote-4.2</artifactId>
                          <version>1.0.0.CR3</version>
                          <scope>test</scope>
                         </dependency>
                         
                         <dependency>
                          <groupId>org.jboss.jbossas</groupId>
                          <artifactId>jboss-as-client</artifactId>
                          <version>4.2.3</version>
                          <type>pom</type>
                          <scope>test</scope>
                      </dependency>
      
                      <dependency>
                          <groupId>org.jboss.deployers</groupId>
                          <artifactId>jboss-deployers-client-spi</artifactId>
                          <version>2.2.0.GA</version>
                          <scope>test</scope>
                      </dependency>
                      
                     </dependencies>
      </profile>
      

       

       

      And my @Deployment method follows the example:

      https://github.com/arquillian/arquillian-container-jbossas/blob/master/jbossas-remote-4.2/src/test/java/org/jboss/arquillian/container/jbossas/remote_4_2/JBossASIntegrationEarTestCase.java

       

      But when deploying the test, I'm gettinng the following error

       

      Caused by: java.lang.NoClassDefFoundError: javax/enterprise/deploy/spi/TargetModuleID
          at org.jboss.arquillian.container.jbossas.remote_4_2.JBossASRemoteContainer.<clinit>(JBossASRemoteContainer.java:56)
          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.impl.loadable.SecurityActions.newInstance(SecurityActions.java:164)
          at org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.createServiceInstance(ServiceRegistryLoader.java:103)
          at org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.all(ServiceRegistryLoader.java:55)
          at org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.onlyOne(ServiceRegistryLoader.java:67)
          at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:94)
          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.bindAndFire(ManagerImpl.java:235)
          at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)
          at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.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.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.start(ManagerImpl.java:260)
          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)
          ... 13 more
      

       

       

      Anyone has an idea of what am I missing?

        • 1. Re: Running EJB tests in Jboss 4.2.3
          José Freitas Newbie

          I changed my profile to

          <profile>

                         <id>jboss-remote-4_2</id>

                         <dependencies>

                             <dependency>

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

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

                              <version>1.0.0.CR3</version>

                              <scope>test</scope>

                             </dependency>

           

                              <dependency>

                              <groupId>org.jboss.client</groupId>

                              <artifactId>jbossall-client</artifactId>

                              <version>4.2.3.GA</version>

                              <scope>provided</scope>

                          </dependency>

           

                             <dependency>

                            <groupId>jboss</groupId>

                            <artifactId>jboss-j2ee</artifactId>

                            <version>4.2.2.GA</version>

                          </dependency>

                         </dependencies>

                        </profile>

           

           

          and it fixed my problem. Now I'm having a problem to connect with the container, but I guess I can fix it configuring the arquillian.xml

          org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not connect to container