4 Replies Latest reply on Mar 31, 2011 12:12 PM by Steven Boscarine

    Does Arquillian Alpha 5 work with TestNG and GFE?  Can't get CDI working.

    Steven Boscarine Apprentice

      Hello All,

      I cannot get TestNG & GFE working together with Arquillian.  I have an application that is working great in Glassfish v 3.1, both embedded and standalone and I am now trying to write tests for the existing functionality.

       

      I tried downloading the latest examples from:

      https://github.com/arquillian/arquillian/tree/master/examples/testng

      and ran:

      mvn test -Pglassfish-embedded-3.1

       

      it is throwing:

       

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

      shouldBeReplacedByAMock(com.acme.cdi.payment.SynchronousPaymentProcessorTestCase)  Time elapsed: 0.116 sec  <<< FAILURE!

      org.jboss.arquillian.spi.ArquillianProxyException: java.lang.AssertionError : expected:<true> but was:<false> [Proxied because : Could not find suitable constructor]

          at org.testng.Assert.fail(Assert.java:89)

          at org.testng.Assert.failNotEquals(Assert.java:480)

       

       

      In my project, I have a different error and I can't get CDI injections to work.  Everything is null.  I know the same classes injected work great in the actual application.  I am starting out with the Java EE archetypes, which have config for Arquillian Alpha 4.  I updated the POM from the examples to get the latest and the TestNG config.

       

      I noticed I get:

      INFO: BeanManager cannot be located at java:comp/BeanManager. Either you are using an archive with no beans.xml, or the BeanManager has not been bound to that location in JNDI.

       

      What does that mean?  Is that a clue to the error?

       

      My error:

       

      Mar 30, 2011 11:24:49 PM org.jboss.arquillian.impl.client.container.ContainerRegistryCreator getActivatedConfiguration

      INFO: Could not read active container configuration: null

      Mar 30, 2011 11:24:50 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient

      INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default.

      Mar 30, 2011 11:24:50 PM org.hibernate.validator.util.Version <clinit>

      INFO: Hibernate Validator null

      Mar 30, 2011 11:24:50 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA

      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      Mar 30, 2011 11:24:51 PM com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy

      INFO: Network listener https-listener on port 0 disabled per domain.xml

      Mar 30, 2011 11:24:51 PM com.sun.enterprise.v3.server.AppServerStartup run

      INFO: GlassFish Server Open Source Edition 3.1 (java_re-private) startup time : Embedded (684ms), startup services(452ms), total(1,136ms)

      Mar 30, 2011 11:24:51 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy$2$1 onReady

      INFO: Grizzly Framework 1.9.31 started in: 136ms - bound to [0.0.0.0:8181]

      Mar 30, 2011 11:24:51 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run

      INFO: JMXStartupService: JMXConnector system is disabled, skipping.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.SecurityLifecycle <init>

      INFO: SEC1002: Security Manager is OFF.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.SecurityLifecycle onInitialization

      INFO: SEC1010: Entering Security Startup Service

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.PolicyLoader loadPolicy

      INFO: SEC1143: Loading policy provider com.sun.enterprise.security.jacc.provider.SimplePolicyProvider.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate

      INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate

      INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate

      INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.security.SecurityLifecycle onInitialization

      INFO: SEC1011: Security Service(s) Started Successfully

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.web.WebContainer createHttpListener

      INFO: WEB0169: Created HTTP listener [http-listener] on host/port [0.0.0.0:8181]

      Mar 30, 2011 11:24:54 PM com.sun.enterprise.web.WebContainer createHosts

      INFO: WEB0171: Created virtual server [server]

      Mar 30, 2011 11:24:55 PM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules

      INFO: WEB0172: Virtual server [server] loaded default web module []

      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)

      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@6337e2dc

      Mar 30, 2011 11:24:56 PM com.sun.enterprise.web.WebApplication start

      INFO: WEB0671: Loading application [test] at [/test]

      Mar 30, 2011 11:24:56 PM org.glassfish.deployment.admin.DeployCommand execute

      INFO: test was successfully deployed in 2,420 milliseconds.

      PlainTextActionReporterSUCCESSDescription: deploy AdminCommandApplication deployed with name test.

          [name=test

      Mar 30, 2011 11:24:56 PM org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher injectClass

      INFO: BeanManager cannot be located at java:comp/BeanManager. Either you are using an archive with no beans.xml, or the BeanManager has not been bound to that location in JNDI.

      hello world

      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)

      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@6337e2dc

      PlainTextActionReporterSUCCESSNo monitoring data to report.

      FAILED: test

      java.lang.NullPointerException

          at test.BasicArquillianTest.test(BasicArquillianTest.java:28)

          at org.jboss.arquillian.testng.Arquillian$1.invoke(Arquillian.java:111)

          at org.jboss.arquillian.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:63)

          at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

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

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

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

          at org.jboss.arquillian.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)

          at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

          at org.jboss.arquillian.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

          at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

          at org.jboss.arquillian.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)

          at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

          at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

          at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:102)

          at org.jboss.arquillian.testng.TestNGTestRunner.execute(TestNGTestRunner.java:54)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:84)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

          at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

          at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

          at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

          at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

          at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

          at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

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

      ... Removed 48 stack frames

       

      ===============================================

          Default test

          Tests run: 1, Failures: 1, Skips: 0

      ===============================================

       

      Mar 30, 2011 11:24:57 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown

      INFO: JMXStartupService and JMXConnectors have been shut down.

      Mar 30, 2011 11:24:57 PM com.sun.enterprise.v3.server.AppServerStartup stop

      INFO: Shutdown procedure finished

      Mar 30, 2011 11:24:57 PM AppServerStartup run

      INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting

       

      Here's my config:

            <dependency>

               <groupId>org.testng</groupId>

               <artifactId>testng</artifactId>

               <version>5.12.1</version>

               <scope>test</scope>

            </dependency>

      <!-- for some reason, I was getting a class not found error due to some guice classes -->

            <dependency>

               <groupId>com.google.inject</groupId>

               <artifactId>guice</artifactId>

               <version>2.0</version>

               <scope>test</scope>

            </dependency>

            <dependency>

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

               <artifactId>arquillian-testng</artifactId>

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

               <scope>test</scope>

            </dependency>

            <dependency>

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

               <artifactId>arquillian-glassfish-embedded-3.1</artifactId>

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

               <scope>test</scope>

            </dependency>

            <dependency>

               <groupId>org.glassfish.extras</groupId>

               <artifactId>glassfish-embedded-all</artifactId>

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

               <scope>test</scope>

            </dependency>

       

      Here's my class:

      package test;

      import javax.inject.Named;

      @Named

      public class Hello {

          @Override

          public String toString() {

              return "Hello World";

          }

      }

      Here's my test:

       

      import javax.inject.Inject;

       

      import org.jboss.arquillian.api.Deployment;

      import org.jboss.arquillian.testng.Arquillian;

      import org.jboss.shrinkwrap.api.Archive;

      import org.jboss.shrinkwrap.api.ShrinkWrap;

      import org.jboss.shrinkwrap.api.asset.EmptyAsset;

      import org.jboss.shrinkwrap.api.spec.WebArchive;

      import org.testng.annotations.Test;

       

      import test.Hello;

       

      @Test(enabled = true)

      public class BasicArquillianTest extends Arquillian {

       

          @Deployment

          public static Archive<?> createTestArchive() {

              return ShrinkWrap.create(WebArchive.class, "test.war")

                      .addClasses(Hello.class)

                      .addAsManifestResource("test-persistence.xml", "persistence.xml")

                      .addAsWebResource(EmptyAsset.INSTANCE, "beans.xml");

          }

       

          public void test() {

              System.out.println("hello world");

              System.out.println(hello.toString());

          }

       

          @Inject

          Hello hello;

      }

       

       

      Any insights into the cause would be greatly appreciated. 

       

      Thanks!!

      Steven

        • 1. Does Arquillian Alpha 5 work with TestNG and GFE?  Can't get CDI working.
          Aslak Knutsen Master

          ShrinkWrap API has changed, use addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

          • 2. Re: Does Arquillian Alpha 5 work with TestNG and GFE?  Can't get CDI working.
            Steven Boscarine Apprentice

            Thanks!

             

            That worked in eclipse, but I'm now getting the error pasted below in maven. 

             

            I noticed http://community.jboss.org/message/594631

             

            I'm guessing my old Alpha4 arquillian.xml from the archetypes is no longer valid?

             

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

            <arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xmlns:jbossas-remote="urn:arq:org.jboss.arquillian.container.jbossas.remote_6" xmlns:glassfish-embedded="urn:arq:org.jboss.arquillian.container.glassfish.embedded_3">

             

               <!-- Required configuration for an embedded GlassFish instance -->

               <glassfish-embedded:container>

                  <glassfish-embedded:bindHttpPort>7070</glassfish-embedded:bindHttpPort>

                  <glassfish-embedded:sunResourcesXml>src/test/resources/sun-resources.xml</glassfish-embedded:sunResourcesXml>

               </glassfish-embedded:container>

            </arquillian>

             

             

             

            If that's the case, where can I find a new example of a valid GFE config?  I didn't notice one in the documentation.

             

             

             

             

            Here's my error:

             

             

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

            Test set: TestSuite

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

            Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 10.886 sec <<< FAILURE!

            test(test.BasicArquillianTest)  Time elapsed: 0.299 sec  <<< FAILURE!

            java.lang.NoSuchMethodError: org.testng.IHookCallBack.getParameters()[Ljava/lang/Object;

                at org.jboss.arquillian.testng.Arquillian$1.invoke(Arquillian.java:110)

                at org.jboss.arquillian.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:63)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

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

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

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

                at org.jboss.arquillian.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

                at org.jboss.arquillian.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

                at org.jboss.arquillian.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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

                at org.jboss.arquillian.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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

                at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:102)

                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.testng.internal.MethodHelper.invokeHookable(MethodHelper.java:769)

                at org.testng.internal.Invoker.invokeMethod(Invoker.java:552)

                at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:723)

                at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1027)

                at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137)

                at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)

                at org.testng.TestRunner.runWorkers(TestRunner.java:1030)

                at org.testng.TestRunner.privateRun(TestRunner.java:709)

                at org.testng.TestRunner.run(TestRunner.java:579)

                at org.testng.SuiteRunner.runTest(SuiteRunner.java:331)

                at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326)

                at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288)

                at org.testng.SuiteRunner.run(SuiteRunner.java:193)

                at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910)

                at org.testng.TestNG.runSuitesLocally(TestNG.java:879)

                at org.testng.TestNG.run(TestNG.java:787)

                at org.jboss.arquillian.testng.TestNGTestRunner.execute(TestNGTestRunner.java:54)

                at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:84)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

                at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

                at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

                at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

                at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

                at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

                at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

                at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

                at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

                at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

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

             

            testInsert(TenantTest)  Time elapsed: 0.004 sec  <<< FAILURE!

            java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

                at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:63)

                at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:56)

                at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:30)

                at org.jboss.arquillian.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:105)

                at org.jboss.arquillian.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:96)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

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

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

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

                at org.jboss.arquillian.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:65)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

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

                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createContext(ContainerDeploymentContextHandler.java:133)

                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createTestContext(ContainerDeploymentContextHandler.java:120)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

                at org.jboss.arquillian.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

                at org.jboss.arquillian.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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

                at org.jboss.arquillian.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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

                at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:102)

                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.testng.internal.MethodHelper.invokeHookable(MethodHelper.java:769)

                at org.testng.internal.Invoker.invokeMethod(Invoker.java:552)

                at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:723)

                at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1027)

                at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137)

                at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)

                at org.testng.TestRunner.runWorkers(TestRunner.java:1030)

                at org.testng.TestRunner.privateRun(TestRunner.java:709)

                at org.testng.TestRunner.run(TestRunner.java:579)

                at org.testng.SuiteRunner.runTest(SuiteRunner.java:331)

                at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326)

                at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288)

                at org.testng.SuiteRunner.run(SuiteRunner.java:193)

                at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910)

                at org.testng.TestNG.runSuitesLocally(TestNG.java:879)

                at org.testng.TestNG.run(TestNG.java:787)

                at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60)

                at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:153)

                at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)

                at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)

                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)

            • 3. Re: Does Arquillian Alpha 5 work with TestNG and GFE?  Can't get CDI working.
              Mark Temple Newbie

              Do you have testng-5.14.6.jar in your classpath?

               

              I would change:

              <version>5.12.1</version>

              to

              <version>5.14.6</version>

               

              I took and ran your sample (w/o maven) and get a null pointer on the @inject Hello hello.

              I can't get any examples to run w/o maven but, going to continue until I do...

              • 4. Re: Does Arquillian Alpha 5 work with TestNG and GFE?  Can't get CDI working.
                Steven Boscarine Apprentice

                Thank you!  That was the cause.

                I was using 5.12.1  just because it's in the documentation.  I changed it to 5.14.6 and it is working in maven and eclipse now!

                 

                      <dependency>

                         <groupId>org.testng</groupId>

                         <artifactId>testng</artifactId>

                         <version>5.14.6</version>

                         <scope>test</scope>

                      </dependency>


                If it helps, I used the JBoss JavaEE 6 archetype. 

                 

                Here's my POM:

                 

                   <properties>

                      <arquillian.version>1.0.0.Alpha5</arquillian.version>

                      <version.glassfish_31>3.1</version.glassfish_31>

                   </properties>

                   <dependencies>

                      <dependency>

                         <groupId>org.testng</groupId>

                         <artifactId>testng</artifactId>

                         <version>5.14.6</version>

                         <scope>test</scope>

                      </dependency>

                      <!-- Used by Arquillian? -->

                      <dependency>

                         <groupId>com.google.inject</groupId>

                         <artifactId>guice</artifactId>

                         <version>2.0</version>

                         <scope>test</scope>

                      </dependency>

                      <dependency>

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

                         <artifactId>arquillian-testng</artifactId>

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

                         <scope>test</scope>

                      </dependency>

                      <dependency>

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

                         <artifactId>arquillian-glassfish-embedded-3.1</artifactId>

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

                         <scope>test</scope>

                      </dependency>

                      <!-- This imports the Java EE 6 runtime libraries provided by GlassFish Embedded -->

                      <dependency>

                         <groupId>org.glassfish.extras</groupId>

                         <artifactId>glassfish-embedded-all</artifactId>

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

                      </dependency>

                   </dependencies>

                 

                I attached my arqullian and sun xml files.

                 

                Hopefully that can help you get started.