7 Replies Latest reply on Nov 15, 2010 3:45 AM by Domenico Nappo

    Problems testing a Session Bean in an embedded glassfish container

    Domenico Nappo Newbie

      Hi there,

       

      Sorry to bother you again but I'm still trying to configure the environment for Integration Testing with Arquillian. I think it's almost done (I hope!). Maybe Arquillian tries to read a web.xml file or something like that? Actually, I don't understand why the container tries to "xml parse" the glassfish-embedded-all jar file (see the exceptions below).

      Any idea???

      I won't post my simple source code since it doesn't seem to be relevant to the problem.

       

      Here how I configured so far (if anyone wants the details, let me know):

       

       

      Environment: NetBeans 6.9.1, Maven2, Embedded GlassFish for testing.

       

      1) I used a different Maven profile for ejb testing with a dependency to glassfish-embedded-all library, to avoid problems/conflicts with javaee-api (used in the default profile)

       

      <dependency>
      <groupId>org.glassfish.extras</groupId>
      <artifactId>glassfish-embedded-all</artifactId>
      <version>3.0.1-b02</version>
      </dependency>

       

      2) I use the following arquillian.xml configuration file with a reference to a sun-resources.xml file (and with a non-standard port to avoid any conflict with other services)

       

      <glassfish:container>
      <glassfish:bindHttpPort>9988</glassfish:bindHttpPort>
      <glassfish:instanceRoot>src/test/glassfish</glassfish:instanceRoot>
      <glassfish:autoDelete>false</glassfish:autoDelete>
      <glassfish:sunResourcesXml>src/test/glassfish/config/sun-resources.xml</glassfish:sunResourcesXml>
      </glassfish:container>

       

      3) The sun-resources.xml file contains definitions for DS pools and resources. This gives the possibility to not include a domain.xml file.

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE resources PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 9.0 Domain//EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_4.dtd">

       

      <resources>
      <jdbc-connection-pool datasource-classname="oracle.jdbc.pool.OracleDataSource" res-type="javax.sql.DataSource" name="oracle-thin_edea_efgprd_metadataPool">
      <property name="URL" value="jdbc:oracle:thin:@edea:1521:edea" />
      <property name="driverClass" value="oracle.jdbc.OracleDriver" />
                <property name="Password" value="xxxx" />
      <property name="portNumber" value="1521" />
      <property name="databaseName" value="edea" />
                <property name="User" value="xxxx" />
      <property name="serverName" value="edea" />
      </jdbc-connection-pool>
      <jdbc-resource pool-name="oracle-thin_edea_efgprd_metadataPool" jndi-name="jdbc/efgprd_metadata_edea" />
      </resources>

       

      Below the exception fired by Arquillian:

       

      LoginMethodTest(eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest)  Time elapsed: 0.002 sec  <<< ERROR!
      org.jboss.arquillian.impl.event.FiredEventException: java.lang.IllegalStateException: Error launching test eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest public void eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest.LoginMethodTest()
      at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:68)
      at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
      at org.jboss.arquillian.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:157)
      at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:244)
      at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:207)
      at org.jboss.arquillian.junit.Arquillian$5$1.evaluate(Arquillian.java:225)
      at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:297)
      at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:221)
      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:163)
      at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:186)
      at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:297)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:182)
      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)
      Caused by: java.lang.IllegalStateException: Error launching test eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest public void eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest.LoginMethodTest()
      at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.invoke(ServletMethodExecutor.java:61)
      at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:50)
      at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:40)
      at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)
      ... 31 more
      Caused by: java.lang.IllegalStateException: Error launching test at http://localhost:9988/test/ArquillianServletRunner?outputMode=serializedObject&className=efg.ejbtests.LoginBeanTest&methodName=LoginMethodTest. Got 500 (Internal Server Error)
      at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.execute(ServletMethodExecutor.java:103)
      at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.invoke(ServletMethodExecutor.java:57)
      ... 34 more

       

       

      ...and this is the exception I see in the output console in NetBeans..I hope it's the relevant part

       

      INFO: Virtual server server loaded system default web module
      Nov 11, 2010 4:47:59 PM org.apache.catalina.core.StandardContext callServletContainerInitializers
      SEVERE: PWC1420: Error invoking ServletContainerInitializer org.apache.jasper.runtime.TldScanner
      org.apache.jasper.JasperException: PWC6177: XML parsing error on file file:/C:/Users/nappodo/MavenRepository/org/glassfish/extras/glassfish-embedded-all/3.0.1-b02/glassfish-embedded-all-3.0.1-b02.jar
      at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:325)
      at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:366)
      at org.apache.jasper.runtime.TldScanner.scanTld(TldScanner.java:526)
      at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:369)
      at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:633)
      at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:282)
      at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:228)
      at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5279)
      at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:550)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5190)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
      at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1523)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1190)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:975)
      at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1523)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1190)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:529)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:946)
      at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:583)
      at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174)
      at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84)
      at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77)
      at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
      at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
      at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
      at org.glassfish.web.embed.impl.EmbeddedWebContainer.start(EmbeddedWebContainer.java:207)
      at org.glassfish.api.embedded.Server$1.start(Server.java:444)
      at org.glassfish.api.embedded.Server.start(Server.java:558)
      at org.jboss.arquillian.container.glassfish.embedded_3.GlassFishEmbeddedContainer.start(GlassFishEmbeddedContainer.java:135)
      at org.jboss.arquillian.impl.handler.ContainerStarter.callback(ContainerStarter.java:52)
      at org.jboss.arquillian.impl.handler.ContainerStarter.callback(ContainerStarter.java:41)
      at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)
      at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
      at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)
      at org.jboss.arquillian.junit.Arquillian.<init>(Arquillian.java:89)
      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.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
      at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)
      at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)
      at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:156)
      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)
      Caused by: java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:529)
      at java.net.Socket.connect(Socket.java:478)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
      at sun.net.www.http.HttpClient.New(HttpClient.java:306)
      at sun.net.www.http.HttpClient.New(HttpClient.java:323)
      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
      at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
      at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:296)
      ... 57 more
      Nov 11, 2010 4:47:59 PM org.apache.catalina.core.StandardContext start
      SEVERE: PWC1306: Startup of context  failed due to previous errors
      Nov 11, 2010 4:47:59 PM org.apache.catalina.core.StandardContext start
      SEVERE: PWC1305: Exception during cleanup after start failed
      org.apache.catalina.LifecycleException: PWC2769: Manager has not yet been started

        • 1. Re: Problems testing a Session Bean in an embedded glassfish container
          Aslak Knutsen Master

          This is a GlassFish issue, It tries to fetch some schemas/dtds from java.sun.com, and fails if offline or behind a proxy.

           

          https://glassfish.dev.java.net/issues/show_bug.cgi?id=11516

           

          Should be fixed in build 3.1 b26+

           

          http://twitter.com/#!/alexismp/status/2736329574055936

          • 2. Re: Problems testing a Session Bean in an embedded glassfish container
            Domenico Nappo Newbie

            Thanks Aslak for your help!

            I've changed to the last version of that jar and that issue has been solved but now I've got a new problem

             

            The test cannot be executed due a Refuse Connection to the arquillian servlet.

            It's strange because I shouldn't have problems with network configurations...

             

            I'll paste the stacktrace below...

             

            LoginMethodTest(eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest)  Time elapsed: 1.002 sec  <<< ERROR!
            org.jboss.arquillian.impl.event.FiredEventException: java.lang.IllegalStateException: Error launching test eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest public void eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest.LoginMethodTest()
                    at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:68)
                    at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
                    at org.jboss.arquillian.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:157)
                    at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:244)
                    at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:207)
                    at org.jboss.arquillian.junit.Arquillian$5$1.evaluate(Arquillian.java:225)
                    at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:297)
                    at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:221)
                    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:163)
                    at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:186)
                    at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:297)
                    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:182)
                    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)
            Caused by: java.lang.IllegalStateException: Error launching test eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest public void eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest.LoginMethodTest()
                    at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.invoke(ServletMethodExecutor.java:61)
                    at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:50)
                    at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:40)
                    at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)
                    ... 31 more
            Caused by: java.net.ConnectException: Connection refused: connect
                    at java.net.PlainSocketImpl.socketConnect(Native Method)
                    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
                    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
                    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
                    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
                    at java.net.Socket.connect(Socket.java:529)
                    at java.net.Socket.connect(Socket.java:478)
                    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
                    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
                    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
                    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
                    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
                    at sun.net.www.http.HttpClient.New(HttpClient.java:323)
                    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
                    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
                    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
                    at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.execute(ServletMethodExecutor.java:81)
                    at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.invoke(ServletMethodExecutor.java:57)
                    ... 34 more

            • 3. Re: Problems testing a Session Bean in an embedded glassfish container
              Aslak Knutsen Master

              Any indication of deployment issues in the server log?

              • 4. Re: Problems testing a Session Bean in an embedded glassfish container
                Domenico Nappo Newbie

                Hi Aslak,

                 

                here the deployment and test's execution logs...it seems ok, doesn't it??

                Logs in the working folder of the instance of glassfish embedded are empty.

                 

                [resources:testResources]
                Using encoding: 'UTF-8' to copy filtered resources.
                Downloading: http://download.java.net/maven/2/org/glassfish/extras/glassfish-embedded-all/3.1-b27/glassfish-embedded-all-3.1-b27.jar
                Unable to find resource 'org.glassfish.extras:glassfish-embedded-all:jar:3.1-b27' in repository java.net2 (http://download.java.net/maven/2)
                Downloading: http://repository.jboss.org/nexus/content/groups/public/org/glassfish/extras/glassfish-embedded-all/3.1-b27/glassfish-embedded-all-3.1-b27.jar
                51284K downloaded  (glassfish-embedded-all-3.1-b27.jar)
                [compiler:testCompile]
                Nothing to compile - all classes are up to date
                [surefire:test]
                Surefire report directory: C:\Users\nappodo\WorkProjects\SourceCode\EFG_MetadataCatalogue_mvn\EFG_MetadataCatalogue_mvn-ejb\target\surefire-reports
                Nov 12, 2010 10:14:18 AM org.jboss.arquillian.impl.XmlConfigurationBuilder loadArquillianConfiguration
                INFO: building configuration from XML file: arquillian.xml
                Nov 12, 2010 10:14:18 AM com.sun.enterprise.util.EarlyLogger add
                INFO: Total time to parse domain.xml: 58 milliseconds
                Nov 12, 2010 10:14:18 AM com.sun.logging.LogDomains$1 log
                INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default.
                Nov 12, 2010 10:14:19 AM com.sun.grizzly.Controller logVersion
                INFO: GRIZZLY0001: Starting Grizzly Framework 1.9.21 - 11/12/10 10:14 AM
                Nov 12, 2010 10:14:19 AM com.sun.logging.LogDomains$1 log
                INFO: GlassFish Server Open Source Edition 3.1-b27 (java_re-private) startup time : Embedded (365ms), startup services(278ms), total(643ms)
                Nov 12, 2010 10:14:19 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy$2$1 onReady
                INFO: Grizzly Framework 1.9.21 started in: 93ms - bound to [127.0.0.1:7676]
                Nov 12, 2010 10:14:19 AM com.sun.logging.LogDomains$1 log
                INFO: enterprise_used_delegate_name
                Nov 12, 2010 10:14:19 AM com.sun.logging.LogDomains$1 log
                INFO: JMXStartupService: JMXConnector system is disabled, skipping.
                Nov 12, 2010 10:14:19 AM AppServerStartup run
                INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
                Nov 12, 2010 10:14:19 AM org.hibernate.validator.util.Version <clinit>
                INFO: Hibernate Validator null
                Nov 12, 2010 10:14:19 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
                INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                Nov 12, 2010 10:14:19 AM org.jboss.arquillian.container.glassfish.embedded_3.GlassFishEmbeddedContainer executeCommand
                INFO: add-resources command result (1): JDBC connection pool oracle-thin_edea_efgprd_metadataPool created successfully.
                Nov 12, 2010 10:14:19 AM org.jboss.arquillian.container.glassfish.embedded_3.GlassFishEmbeddedContainer executeCommand
                INFO: add-resources command result (2): JDBC resource jdbc/efgprd_metadata_edea created successfully.

                 

                -------------------------------------------------------
                T E S T S
                -------------------------------------------------------
                Running eu.ec.jrc.ies.efas.efg.ejbtests.LoginBeanTest
                Nov 12, 2010 10:14:19 AM org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader findExtensionImpl
                WARNING: Multiple extension implementations found for org.jboss.shrinkwrap.api.spec.JavaArchive, please verify classpath or add a extensionOverride
                Nov 12, 2010 10:14:19 AM org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader findExtensionImpl
                WARNING: Multiple extension implementations found for org.jboss.shrinkwrap.api.spec.WebArchive, please verify classpath or add a extensionOverride
                Nov 12, 2010 10:14:19 AM org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader findExtensionImpl
                WARNING: Multiple extension implementations found for org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive, please verify classpath or add a extensionOverride
                Nov 12, 2010 10:14:19 AM org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader findExtensionImpl
                WARNING: Multiple extension implementations found for org.jboss.shrinkwrap.api.exporter.ZipExporter, please verify classpath or add a extensionOverride
                Nov 12, 2010 10:14:19 AM org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader findExtensionImpl
                WARNING: Multiple extension implementations found for org.jboss.shrinkwrap.spi.Configurable, please verify classpath or add a extensionOverride
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: security.secmgroff
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: sec.service.startup.enter
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: policy.loading
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: realm.loaded.successfully
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: realm.loaded.successfully
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: realm.loaded.successfully
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: sec.service.startup.exit
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: webContainer.virtualServer.created
                Nov 12, 2010 10:14:20 AM com.sun.logging.LogDomains$1 log
                INFO: webContainer.virtualServer.loadedDefaultWebModule
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                WARNING: using.default.ds
                Nov 12, 2010 10:15:03 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
                INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                WARNING: using.default.ds
                classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
                SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@77984161
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                INFO: StatefulContainerBuilder.buildStoreManager() storeName: LoginBean-84512162470297600-BackingStore
                Nov 12, 2010 10:15:03 AM org.glassfish.ha.store.adapter.file.FileBackingStore initialize
                INFO: [FileBackingStore::initialize] Successfully Created and initialized store. Working dir: C:\Users\nappodo\WorkProjects\SourceCode\EFG_MetadataCatalogue_mvn\EFG_MetadataCatalogue_mvn-ejb\src\test\glassfish\session-store\LoginBean-84512162470297600; Configuration: BackingStoreConfiguration{clusterName='null', instanceName='null', storeName='LoginBean-84512162470297600-BackingStore', shortUniqueName='84512162470297600', storeType='file', maxIdleTimeInSeconds=-1, relaxVersionCheck='null', maxLoadWaitTimeInSeconds=0, baseDirectoryName='C:\Users\nappodo\WorkProjects\SourceCode\EFG_MetadataCatalogue_mvn\EFG_MetadataCatalogue_mvn-ejb\src\test\glassfish\session-store\LoginBean-84512162470297600', keyClazz=interface java.io.Serializable, valueClazz=class com.sun.ejb.spi.sfsb.store.SFSBBeanState, synchronousSave=false, typicalPayloadSizeInKiloBytes=0, vendorSpecificSettings={start.gms=false, async.replication=true, local.caching=true}}
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                WARNING: StatefulContainerbuilder instantiated store: org.glassfish.ha.store.adapter.file.FileBackingStore@138532dc; ha-enabled: false ==> BackingStoreConfiguration{clusterName='null', instanceName='null', storeName='LoginBean-84512162470297600-BackingStore', shortUniqueName='84512162470297600', storeType='file', maxIdleTimeInSeconds=-1, relaxVersionCheck='null', maxLoadWaitTimeInSeconds=0, baseDirectoryName='C:\Users\nappodo\WorkProjects\SourceCode\EFG_MetadataCatalogue_mvn\EFG_MetadataCatalogue_mvn-ejb\src\test\glassfish\session-store\LoginBean-84512162470297600', keyClazz=interface java.io.Serializable, valueClazz=class com.sun.ejb.spi.sfsb.store.SFSBBeanState, synchronousSave=false, typicalPayloadSizeInKiloBytes=0, vendorSpecificSettings={start.gms=false, async.replication=true, local.caching=true}}
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                INFO: Portable JNDI names for EJB LoginBean : [java:global/test/LoginBean!eu.ec.jrc.ies.efas.efg.ejb.LoginBeanLocal, java:global/test/LoginBean]
                Nov 12, 2010 10:15:03 AM com.sun.logging.LogDomains$1 log
                INFO: webApplication.loadingApplication
                classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
                SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@77984161
                Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 46.531 sec <<< FAILURE!

                • 5. Re: Problems testing a Session Bean in an embedded glassfish container
                  Domenico Nappo Newbie

                  I notice that Grizzly is bound to 7676 port number:

                   

                  Sorry...this should be the service for JMS. However, it seems that the http service doesn't start:

                  during the tests execution I issued the

                  netstat -aon | findstr <portNumberDefinedInArquillian.xml> command and saw nothing, while issuing the netstat -aon | findstr 7676 command, for example, I can see the LISTENING service.

                   

                  Nov 12, 2010 10:14:19 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy$2$1 onReady
                  INFO: Grizzly Framework 1.9.21 started in: 93ms - bound to [127.0.0.1:7676]

                   

                  Then it's a different port from the one I set in arquillian.xml (with previous versions of emb gf grizzly was bound to the port specified in arquillian.xml).

                  Then, I've tried to change the port to 7676 and I've got an error in initialisation of jms service (i guess):

                   

                  INFO: Portable JNDI names for EJB LoginBean : [java:global/test/LoginBean!eu.ec.jrc.ies.efas.efg.ejb.LoginBeanLocal, java:global/test/LoginBean]
                  Nov 12, 2010 10:37:03 AM com.sun.logging.LogDomains$1 log
                  INFO: webApplication.loadingApplication
                  Nov 12, 2010 10:37:03 AM com.sun.logging.LogDomains$1 log
                  WARNING: jmsra.upgrade_check_failed
                  Nov 12, 2010 10:37:03 AM com.sun.logging.LogDomains$1 log
                  SEVERE: rardeployment.connector_descriptor_read_error
                  Nov 12, 2010 10:37:03 AM com.sun.logging.LogDomains$1 log
                  SEVERE:
                  com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors
                          at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:212)
                          at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:335)
                          at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:350)
                          at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.initializeService(ActiveJmsResourceAdapter.java:2172)
                          at com.sun.enterprise.v3.services.impl.ServiceInitializerHandler.onAcceptInterest(ServiceInitializerHandler.java:105)
                          at com.sun.grizzly.SelectorHandlerRunner.handleSelectedKey(SelectorHandlerRunner.java:300)
                          at com.sun.grizzly.SelectorHandlerRunner.handleSelectedKeys(SelectorHandlerRunner.java:263)
                          at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:200)
                          at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:132)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                          at java.lang.Thread.run(Thread.java:619)
                  Caused by: java.io.FileNotFoundException: /C:/Users/nappodo/WorkProjects/SourceCode/EFG_MetadataCatalogue_mvn/EFG_MetadataCatalogue_mvn-ejb/src/test/glassfish/lib/install/applications/jmsra
                          at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:89)
                          at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:191)
                          ... 11 more

                   

                  Message was edited by: Domenico Nappo

                  • 7. Re: Problems testing a Session Bean in an embedded glassfish container
                    Domenico Nappo Newbie

                    Many Thanks Aslak,

                     

                    Maybe I've misconfigured something but I will try it when a more stable version is out.

                     

                    Meanwhile I've changed to GF remote and it seems I've got new problems:)

                     

                    You will hear from me soon