0 Replies Latest reply on Dec 27, 2011 10:20 AM by sakshi jain

    Errors while running arquillian sample tests with embedded glassfish and remote glassfish profile

    sakshi jain Newbie

      Hi,

      I have been trying to run the following arquillian examples (https://github.com/arquillian/arquillian-examples) with embedded glassfish and remote glassfish profiles.I had no difficulty running ejb31-gfembedded,ejb31-jbembedded,ejb3-openejb with embedded glassfish profile except the following change I had to make(highlighted)  for the tests to run correctly:

      <dependency>

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

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

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

      </dependency>

      However, when I try running jpa2 , jpalab, quickstart, xa with embedded glassfish or remote glassfish profile I get a errors which are different for embedded and remote glassfish for the same sample.

      For instance, when I run "jpalab" with embedded glassfish profile I get the follwoing error:

      /home/sakshi/Downloads/arquillian-arquillian-examples-d7b0ab4/jpalab/src/test/java/com/acme/jpa/business/RepositoryTestCase.java:[54,9] cannot find symbol

      symbol  : method addManifestResource(java.lang.String,java.lang.String)

      location: interface org.jboss.shrinkwrap.api.spec.JavaArchive

       

      /home/sakshi/Downloads/arquillian-arquillian-examples-d7b0ab4/jpalab/src/test/java/com/acme/jpa/business/GamePersistenceTestCase.java:[51,12] cannot find symbol

      symbol  : method addManifestResource(java.lang.String,java.lang.String)

      location: interface org.jboss.shrinkwrap.api.spec.JavaArchive

       

      Now when I realise that for arquillian version 1.0.0.Alpha5 I need to change the function name to "addAsManifestResource" I get the following errors for both the tests in the example:

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

       

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.81 sec <<< FAILURE! testInsert(com.acme.jpa.business.GamePersistenceTestCase)  Time elapsed: 0.004 sec  <<< ERROR! 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.GeneratedMethodAccessor29.invoke(Unknown Source) 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.GeneratedMethodAccessor28.invoke(Unknown Source) 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.GeneratedMethodAccessor27.invoke(Unknown Source) 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.junit.Arquillian$6.evaluate(Arquillian.java:251) at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:214) at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303) at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45) at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:228) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:173) at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303) at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45) at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:187) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) 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.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

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

      Now when this test is run with remote glassfish profile, I get  the following warnings on the terminal:

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

      INFO: Adding the following classes declared in META-INF/services/jersey-client-components to the client configuration:   class com.sun.jersey.multipart.impl.MultiPartConfigProvider   class com.sun.jersey.multipart.impl.MultiPartReader   class com.sun.jersey.multipart.impl.MultiPartWriter 27 Dec, 2011 8:38:20 PM com.sun.jersey.spi.inject.Errors processErrorMessages SEVERE: The following errors and warnings have been detected with resource and/or provider classes:   SEVERE: Missing dependency for constructor public com.sun.jersey.multipart.impl.MultiPartReader(javax.ws.rs.ext.Providers,com.sun.jersey.multipart.MultiPartConfig,com.sun.jersey.spi.CloseableService) at parameter index 2   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultListJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.CommandResourceGetResultJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultHtmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.OptionsResultJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.TreeNodeHtmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultListXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.StringResultJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.StringResultXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.StringResultHtmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.OptionsResultXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.TreeNodeXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.CommandResourceGetResultHtmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.CommandResourceGetResultXmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.GetResultListHtmlProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.TreeNodeJsonProvider.uriInfo   SEVERE: Missing dependency for field: protected javax.ws.rs.core.UriInfo org.glassfish.admin.rest.provider.FormWriter.uriInfo

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

      And when I check surefire report I see the following exception for both the tests:

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

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

       

      I am facing issues running jpalab, jpa2 , quickstart and xa.

      Any inputs on what needs to be done to run these tests correctly with the above mentioned profiles?

       

      Thanks,

      Sakshi