1 Reply Latest reply on Mar 2, 2011 4:28 AM by kpiwko

    Embedded glassfish not been configured by arquillian.xml

    justinwyer

      I am running Arquillian stand alone in Netbeans. Using Arquillian next branch and Shrinkwrap SW140 branch off github (both checked out yesterday). I figure my problem is probably configuration related. Arquillian loads the xml file and creates the descriptor okay. But when it creates the GlassfishContainer it does so with the default configuration on line 89 of ContainerRegistryContainer.java -

       

      {code}reg.create(new ContainerDefImpl().setContainerName("default"), serviceLoader);{code}

       

      I think this possibly has something to do with a lack of arquillian.launch, I am unable to figure out what I should be placing in such a file.

       

      I am using glassfish 3.1 and JUnit 4.8.2. Glassfish starts fine and the test deploys but dies when it intializes the JPA because the jdbc resource is not available via jndi, obviously due to my container config not been applied by Arquillian.

       

      Here is my arquillian.xml

       

      {code:xml}<?xml version="1.0"?>

      <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_1">

         <glassfish:container name="default">

            <glassfish:sunResourcesXml>META-INF/test-sun-resources.xml</glassfish:sunResourcesXml>

         </glassfish:container>

      </arquillian>{code}

       

      Thanks

        • 1. Re: Embedded glassfish not been configured by arquillian.xml
          kpiwko

          Hi,

           

          if you are using arquillian/next, the configuration there was rewritten using ShrinkWrap Descriptors. So the configuration would look like

           

          <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="glassfish" default="true">
                     <configuration>
                         <property name="sunResourcesXml">META-INF/sun-test-resources.xml</property>        
                     </configuration>
                 </container>
          </arquillian>
          
          

           

          You can take a look at GlassFish Embedded container module in Arquillian, which contains such a file.