Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-3111

@ArquillianResource InitialContext injection does not work in @RunAsClient annotated tests (remote JNDI)

XMLWordPrintable

      @ArquillianResource InitialContext injection does not work in @RunAsClient annotated tests.

      Exception thrown:
      java.lang.RuntimeException: Could not lookup value for field private javax.naming.InitialContext org.jboss.as.test.integration.management.cli.InitialContextArqInjectTestCase.context
      at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:61)
      at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52)
      at org.jboss.arquillian.container.test.impl.ClientTestInstanceEnricher.enrich(ClientTestInstanceEnricher.java:51)
      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.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)
      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.createTestContext(TestContextHandler.java:89)
      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.createClassContext(TestContextHandler.java:75)
      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:60)
      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.before(EventTestRunnerAdaptor.java:95)
      at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
      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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
      Caused by: java.lang.RuntimeException: Provider for type class javax.naming.InitialContext returned a null value: org.jboss.arquillian.container.test.impl.enricher.resource.InitialContextProvider@3041876
      at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.lookup(ArquillianResourceTestEnricher.java:115)
      at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:57)
      ... 71 more

              arubinge@redhat.com Andrew Rubinger (Inactive)
              dpospisil Dominik Pospisil (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: