Skip to end of metadata
Go to start of metadata

An Arquillian container adapter (DeployableContainer implementation) that can run and connect to a embedded(same JVM) GlassFish 3.1 instance. This implementation has lifecycle support, so the container will be started and stopped as part of the test run.

Container Injection Support Matrix

@EJB @EJB (no-interface) @Inject (CDI) @Inject (MC) @PersistenceContext @PersistenceUnit


Default Protocol: Servlet 3.0

Container Configuration Options

Name Type Default Description
bindHttpPort int 8181 The HTTP port the server should bind to.
instanceRoot String   The instanceRoot to use for booting the server. If it does not exist, a default structure will be created.
installRoot String   The installRoot to use for booting the server. If it does not exist, a default structure will be created.
configurationXml String   The relative or absolute path to the domain.xml file that will be used to configure the instance. If absent, the default domain.xml configuration will be used.
configurationReadOnly boolean false If true deployment changes are not written to the configuration and persisted.
sunResourcesXml String   The relative or absolute path to the sun-resources.xml file that will be used to add resources to the instance using the add-resources asadmin command.

Example Maven profile:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 19, 2013

    do you have a sample for minimum domain.xml configuration that will work with arquillian?

    I copied the arguillian generated domain.xml and use it as the value of configurationXml, but it does not work. All my test starts to fail.

    I just wanted to change the ports so I can safely run it inside jenkins that is hosted inside a glassfish container. The test is using same ports as the glassfish container that hosts jenkins.

    1. Jul 19, 2014

      You can get domain configuration from standalone glassfish installation ($GLASSFISH_HOME/domains/domain1).You need to copy config and docroot directories to your test resources and specify instanceRoot path in arquillian.xml:

      After that you can modify config/domain.xml to create custom configuration.

  2. Apr 05, 2013

    I also wish to change the ports as I am running it inside Jenkins hosted also inside a GF container...

    1. Aug 29, 2013

      Hi Patrick,

      here's my minimal setup for GF embedded with custom datasource and changed port. I do not need domain.xml for this.

      1. Jan 27, 2015

        Hi Patrik,

        you are right, for the HTTP port this setup is enough. But if you run multiple jobs with this configuration on a ci server in parallel only the first job will be successfull, as glassfish uses 12 ports:

        As far as the arquillian documentation goes, there is no way to configure all of theses ports using only the arquillian.xml