2 Replies Latest reply on Aug 27, 2014 10:37 AM by tilm4nn

    NPE in Graphene.goTo in @Before with Arquillian 1.1.5

    tilm4nn

      Today I tried to update to Arqillian 1.1.5, Drone 1.3.1 and Graphene 2.0.3. because I liked to try the new improved Junit Rules functionality.

       

      But now I get the following Exception in a call to Graphene.goTo in an @Before method that is used to login a user before the test.

       

      java.lang.NullPointerException

        at org.jboss.arquillian.graphene.location.LocationEnricher.getURLFromLocationWithRoot(LocationEnricher.java:105)

        at org.jboss.arquillian.graphene.location.LocationEnricher.getURLFromLocation(LocationEnricher.java:121)

        at org.jboss.arquillian.graphene.location.LocationEnricher.handleLocationOf(LocationEnricher.java:95)

        at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:80)

        at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:125)

        at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:120)

        at org.jboss.arquillian.graphene.Graphene.goTo(Graphene.java:291)

        at test.client.NavigationHelper.ensureOnPage(NavigationHelper.java:25)

        at test.client.NavigationHelper.ensureOnAppPage(NavigationHelper.java:20)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:130)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.invoke(GrapheneContextualHandler.java:159)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$2.call(GrapheneContextualHandler.java:209)

        at org.jboss.arquillian.graphene.context.BrowserActions.performAction(BrowserActions.java:62)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:205)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:229)

        at test.client.NavigationHelper$$EnhancerByGraphene$$5dfbc8e9.ensureOnAppPage(<generated>)

        at test.client.LoginHelper.ensureUserIsLoggedIn(LoginHelper.java:41)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:130)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.invoke(GrapheneContextualHandler.java:159)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$2.call(GrapheneContextualHandler.java:209)

        at org.jboss.arquillian.graphene.context.BrowserActions.performAction(BrowserActions.java:62)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:205)

        at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:229)

        at test.client.LoginHelper$$EnhancerByGraphene$$2d540622.ensureUserIsLoggedIn(<generated>)

        at test.client.ClientLoginTestBase.ensureUserIsLoggedIn(ClientLoginTestBase.java:24)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)

        at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:267)

        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

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

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

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

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

        at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)

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

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

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

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.eclipse.jdt.internal.launching.LongCommandLineLauncher.main(LongCommandLineLauncher.java:43)

       

      Seems like Graphene can no longer find the active ClassContextImpl to get the base URL of the deployment from.

       

      Do I have to change something in my test implementation?

       

      EDIT:

      Just to try it out I rewrote the code to use an ExternalResource Junit Rule instead of an @Before method with the same Exception as result.

       

      Regards, Tilmann