10 Replies Latest reply on Mar 23, 2011 10:46 AM by Aslak Knutsen

    Glassfish Embedded Configuration

    Ryan Cuprak Newbie

      Hello,

      I've been reading over the docs all morning and am rather puzzled. Below is the my Arquillian xml file from Alpha4 - what's the equivalent for 5?

       

      arquillian.xml

      <arquillian xmlns="http://jboss.com/arquillian"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns:glassfish="urn:arq:org.jboss.arquillian.container.glassfish.embedded_3">

          <glassfish:container>

              <glassfish:instanceRoot>src/test/resources/glassfish</glassfish:instanceRoot>

              <glassfish:bindPort>9090</glassfish:bindPort>

              <glassfish:autoDelete>false</glassfish:autoDelete>

          </glassfish:container>

      </arquillian>

       

      The example from the Alpha5 documentation looks much different (I know this is for a remote container):

      <arquillian xmlns="http://jboss.com/arquillian"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

      <container qualifier="jbossas" default="true">

           <configuration>

              <property name="providerUrl">jnp://test.example.com:1099</property>

           </configuration>

           <protocol type="Servlet 3.0">

              <configuration>

                  <property name="host">test.example.com</property>

                  <property name="port">8181</property>

              </configuration>

           </protocol>

      </container>

      </arquillian>

       

      Is there an example somewhere with an embedded glassfish container? I thought about doing something like this:

      <arquillian xmlns="http://jboss.com/arquillian"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

      <container qualifier="myglassfish" default="true">>

           <protocol type="Servlet 3.0">

              <configuration>

                  <property name="configurationXml">domain.xml</property>

              </configuration>

           </protocol>

      </container>

      </arquillian

       

      But I wasn't sure how Arquillian would know that I am using Glassfish and not JBoss etc. I wasn't even that this is what I am supposed to do.

       

      Related to this question is how the PersistenceDescriptor works. In src/test/resources/glassfish/config I place an domain.xml with configured datasources. In my test's create deployment I had this statement "addManifestResource("test-persistence.xml", ArchivePaths.create("persistence.xml"))." How do I replicate the my old stuff with the PersistenceDescriptor? Does the descriptor synthesize a file for me?

       

      Thanks,

      -Ryan

       

      PS. I like the changes.

        • 1. Re: Glassfish Embedded Configuration
          Aslak Knutsen Master

          Ryan Cuprak wrote:

           

          Hello,

          I've been reading over the docs all morning and am rather puzzled. Below is the my Arquillian xml file from Alpha4 - what's the equivalent for 5?

           

          Something in the lines of:

           

          <arquillian xmlns="http://jboss.com/arquillian"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
          
          
                    <container qualifier="myglassfish" default="true">
                              <configuration>
                                        <property name="configurationXml">domain.xml</property>
                              </configuration>
                    </container>
          </arquillian>
          

           

          default=true means that this is the one to use if non are specified.

           

          qualifier= is a name you can refere to from -Darquillian.launch or a file called arquillian.launch or if inside a group element, can be refered to from @TargetsContainer("name")

           

           

          Ryan Cuprak wrote:

           

          But I wasn't sure how Arquillian would know that I am using Glassfish and not JBoss etc. I wasn't even that this is what I am supposed to do.

           

          Arquillian doesn't know anymore. You tell it what to use.

           

           

          Ryan Cuprak wrote:

           

           

          Related to this question is how the PersistenceDescriptor works. In src/test/resources/glassfish/config I place an domain.xml with configured datasources. In my test's create deployment I had this statement "addManifestResource("test-persistence.xml", ArchivePaths.create("persistence.xml"))." How do I replicate the my old stuff with the PersistenceDescriptor? Does the descriptor synthesize a file for me?

           

           

          Descriptor will create a in memory representation of the content of a file. You can then export that as a String and add that content to a Archive.

           

                         .addAsManifestResource(new StringAsset(
                               Descriptors.create(PersistenceDescriptor.class)
                                  .persistenceUnit("Domain")
                                     .provider(ProviderType.HIBERNATE)
                                     .transactionType(TransactionType.JTA)
                                     .classes(User.class)
                                     .excludeUnlistedClasses()
                                     .jtaDataSource("java:/DefaultDS")
                                     .schemaGenerationMode(SchemaGenerationModeType.CREATE_DROP)
                                  .exportAsString()), "persistence.xml");
          
          
          • 3. Re: Glassfish Embedded Configuration
            Ryan Cuprak Newbie

            I've made some progress with Glassfish but have hit a wall with Glassfish refusing to start due to a "URI is not absolute". 

             

            This is my Arquillian config file:

            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <arquillian xmlns="http://www.jboss.org/arquillian-1.0"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.jboss.org/arquillian-1.0 http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
                <engine>
                    <property name="deploymentExportPath">target/</property>
                </engine>
                <container qualifier="glassfish" default="true">
                    <configuration>
                        <property name="configurationXml">src/test/resources/domain.xml</property>
                    </configuration>
                </container>
            </arquillian>
            

             

            I copied the domain.xml from my glassfish 3.1 installation - it was a clean installation and the file only contains an additional datasource configuration. I am assuming that it is complaining about the domain.xml.

            Note: I am running the build from the commandline (mvn test).

             

            The exception that I get:

             

            java.lang.IllegalArgumentException: URI is not absolute
                      at java.net.URI.toURL(URI.java:1080)
                      at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.createTempInstanceRoot(StaticGlassFishRuntime.java:220)
                      at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.setEnv(StaticGlassFishRuntime.java:164)
                      at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:100)
                      at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:115)
                      at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:51)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$4.perform(ContainerLifecycleController.java:126)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$4.perform(ContainerLifecycleController.java:106)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:183)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.setupContainer(ContainerLifecycleController.java:105)
                      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.createContainerContext(ContainerDeploymentContextHandler.java:78)
                      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.core.ManagerImpl.fire(ManagerImpl.java:106)
                      at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$1.perform(ContainerLifecycleController.java:68)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$1.perform(ContainerLifecycleController.java:61)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.forEachContainer(ContainerLifecycleController.java:176)
                      at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.setupContainers(ContainerLifecycleController.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.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.client.ContainerEventController.execute(ContainerEventController.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.invokeObservers(EventContextImpl.java:98)
                      at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
                      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.core.ManagerImpl.fire(ManagerImpl.java:106)
                      at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:58)
                      at org.jboss.arquillian.junit.Arquillian.<init>(Arquillian.java:86)
                      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.execute(JUnit4TestSet.java:51)
                      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
                      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
                      at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
                      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:350)
                      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
            
            
            • 4. Re: Glassfish Embedded Configuration
              Ryan Cuprak Newbie

              I pasted the full path into the file to see what would happen after I got past that problem.

               

              I see this in the log file for the test:

              testCreateSpeaker(org.ctjava.services.TestSpeakerService)  Time elapsed: 0.016 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)

              ...

               

              and this appears on the console:

               

              INFO: Could not read active container configuration: null
              java.lang.IllegalArgumentException: URI is not absolute
                        at java.net.URI.toURL(URI.java:1080)
                        at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.createTempInstanceRoot(StaticGlassFishRuntime.java:220)
                        at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.setEnv(StaticGlassFishRuntime.java:164)
                        at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:100)
                        at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:115)
                        at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:51)
                        at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$4.perform(ContainerLifecycleController.java:126)
                        at org.jboss.arquillian.impl.client.container.ContainerLifecycleController$4.perform(ContainerLifecycleController.java:106)
                        at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:183)
                        at org.jboss.arquillian.impl.client.container.ContainerLifecycleController.setupContainer(ContainerLifecycleController.java:105)
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              ...
              

               

               

              So it doesn't appear to matter whether I pass a relative or absolute path to the file.

              • 5. Re: Glassfish Embedded Configuration
                Aslak Knutsen Master
                1 of 1 people found this helpful
                • 6. Re: Glassfish Embedded Configuration
                  Ryan Cuprak Newbie

                  Passing the absolute path got me further! I did see the defect filed on it while researching it further last night.

                   

                  Now that it finds my domain.xml file, I am getting the following exception (pasted cause piece):

                   

                  Caused by: org.glassfish.embeddable.GlassFishException: PlainTextActionReporterFAILURENo configuration found for server.network-config.network-listeners.network-listener.http-listener
                            at com.sun.enterprise.glassfish.bootstrap.ConfiguratorImpl.configure(ConfiguratorImpl.java:71)
                            at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.configure(GlassFishImpl.java:71)
                            at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.<init>(GlassFishImpl.java:65)
                            at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime$1.<init>(StaticGlassFishRuntime.java:107)
                            at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:107)
                            at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:115)
                            ... 75 more
                  

                   

                  I've attached the domain.xml file. That domain.xml file I simply copied from my Glassfish 3.1 server after configuring the datasources. I did the same thing for Alpha4 and Glassfish 3.0.1 (copying domain.xml file after configuring datasources). Can I just take a domain.xml from a 3.1 or is Arquillian expecting a certain setup?

                   

                  Since the file has http-listern-1 I am guessing that I need to add a "http-listener."? (I will try this but if it does work, I am curious as to what the expectations are and whether I am barking up the wrong tree with my approach.)

                   

                  Thanks,

                  -Ryan

                  • 7. Re: Glassfish Embedded Configuration
                    Aslak Knutsen Master

                    We do have this line in arq:

                     

                     

                          serverProps.setConfigFileReadOnly(configuration.isConfigurationReadOnly());
                          serverProps.setPort("http-listener", configuration.getBindHttpPort());
                    
                    

                     

                    But if the domain.xml you supply is the same as GlassFish embedded use by default, then it's a bit strange that it works without setting it..

                     

                    But yea, try to add a listener named "http-listener"

                    • 8. Re: Glassfish Embedded Configuration
                      Ryan Cuprak Newbie

                      I changed http-listener-1 to http-listener in my domain.xml (copied from Glassfish install - not embedded Glassfish). My build now succeeds but the tests fails. Digging into it I discovered that the http-listener-2 was causing the problem with the exception below (

                       

                      Console message:

                      SEVERE: Shutting down v3 due to startup exception : No free port within range: 8181=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@4cc5f20f
                      

                       

                      Exception:

                      -------------------------------------------------------------------------------
                      Test set: org.ctjava.services.TestSpeakerService
                      -------------------------------------------------------------------------------
                      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.941 sec <<< FAILURE!
                      org.ctjava.services.TestSpeakerService  Time elapsed: 0 sec  <<< ERROR!
                      java.lang.ExceptionInInitializerError
                                at java.io.File.deleteOnExit(File.java:939)
                                at org.jboss.arquillian.container.glassfish.embedded_3_1.ShrinkWrapUtil.toURL(ShrinkWrapUtil.java:52)
                                at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:162)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:141)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:226)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)
                                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.createDeploymentContext(ContainerDeploymentContextHandler.java:100)
                                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.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:78)
                                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.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.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.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.core.ManagerImpl.fire(ManagerImpl.java:106)
                                at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:217)
                                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)
                                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)
                      ...
                      Caused by: java.lang.IllegalStateException: Shutdown in progress
                                at java.lang.Shutdown.add(Shutdown.java:62)
                                at java.lang.System$2.registerShutdownHook(System.java:1163)
                                at java.io.DeleteOnExitHook.<clinit>(DeleteOnExitHook.java:20)
                                ... 93 more
                      

                       

                      I removed the http-listener-2 completely from the file and it then worked. I haven't looked at the source but I am guessing someone was expecting port 8181.

                      • 9. Re: Glassfish Embedded Configuration
                        Aslak Knutsen Master

                        Interesting.. Based on the Exception Arquillian shows it seems like Embedded GlassFish has a System.exit() somewhere.. got to investigate.

                        • 10. Re: Glassfish Embedded Configuration
                          Aslak Knutsen Master

                          The default domain.xml from GlassFish standalone has "http-listener-2" setup on port 8181.

                           

                          The default port for GlassFish embedded is 8181 and we set that on "http-listener". So it conflicts with the other listener and won't start and forcefully shutsdown the jvm.

                           

                          Setting the bindHttpPort in arquillian.xml should solve the port conflict issue.

                           

                          As for the forcefull shutdown, I can set a --noforcedshutdown flag in the GlassFishProperties that we pass in during setup, but then it doesn't throw a exception or anything. And seems to move on like nothing happen, and just randomly failing later. Got to figure out how exception handling in GlassFish Embeddded actually works..