KB‎ > ‎

Creating a new CAPS 6-ready GlassFish domain


CAPS 5.1.x users will notice that there is no longer a domain manager tool to simplify domain management tasks such as domain creation. This was effectively tied to the Sun SeeBeyond Integration Server, which no longer exists, but the domain manager may return in future releases.

Firstly, after you install CAPS 6, just take a complete backup of the domain1 folder (and its subfolders) created for you in .../JavaCAPS6/appserver/domains. This domain already has all the CAPS-specific runtime bits added to it and will make things a lot easier should you need to restore to a fresh instance. You should also do this as and when you install ESRs although at the time of writing this it's still a tad early to be talking about ESRs. You can take backups using an asadmin task, but I personally prefer good old fashioned tar/zip files.

NB: Ensure that the domain is stopped before you take the backup.

Steps to create a new CAPS 6 domain

  1. Create the new domain

    Ensure the .../appserver/bin folder is in your path (for asadmin) and create a new domain "domain2" with:

    asadmin create-domain --portbase 19000 domain2

    When prompted, use either the following defaults or your preferred values:

    Username = admin
    Password = adminadmin
    Master Password = changeit

  2. Add STCMS to the new domain (optional)

    If you require STCMS (SeeBeyond JMS) support in the new domain, install embedded STCMS support into the new domain with:

    asadmin create-stcms --domainname domain2 --stcmsport 19007 IQ_Manager_19007

    Stcms instance created:
    Domain Path: C:\dev\CAPS6\appserver\domains\domain2
    Domain Name: domain2
    Stcms Name: IQ_Manager_19007
    Stcms Port: 19007
    Stcms SSL Port: 19008
    Stcms Enabled: true

  3. Start the new domain

    Start the new domain with:

    asadmin start-domain domain2

    NB: You may see a NullPointerException when starting up the domain for the first time. This is due to Access Manager not being set up correctly on the new domain (a known issue). You can suppress the NPE by adding the following entry:


    into the file domains/<domain-name>/config/domain-registry before starting the domain for the first time.
    The first time you start the domain you will see the following message:

    Error: Access Manager - Can't find the node /domain/applications/lifecycle-module[@name='AMConfiguratorLifeCycleModule']/@enabled
    The operation DISABLE on the addon am-configurator is complete.

    Subsequent starts will now not display the error.

  4. Install Runtime Installation

    Install the extra bits for CAPS 6, known as the Runtime Installation.

    You can do this either by configuring system properties or using a properties file. I choose to do this using the latter. For this, you need to locate and modify the install.properties file in your .../JavaCAPS6/appserver/addons/caps folder.

    Modify the following properties as necessary for your new domain. If you've used a different password, modify the relevant password fields also (the property names are self-explanatory).

    # The name of the domain

    # The admin http or https port

    If you require UDDI support (a WAR file to be deployed):

    # ----- UDDI ------------------------------------------------------------------
    # If the UDDI .war files need to be deployed, change this to true

    Likewise, if you require STCMS (SeeBeyond JMS) support set the following:

    # ----- STCMS -----------------------------------------------------------------
    # If STCMS needs to be installed, change this to true

    ...and uncomment the required operating system for installation, e.g. for Windows:

    Now, with domain2 running, execute the following to apply the CAPS 6 runtime using the new properties:

    asant -f ../addons/caps/install.xml

    NB: The above command assumes you are running it from the .../appserver/bin folder

  5. Install JBI components

    If you are using JBI components, you can install the required shared libraries, service engines and binding components individually from JavaCAPS6\appserver\addons\jbi-components. You should install the two shared libraries before installing any service engines and binding components.

    To install shared libraries from the command line, use:

    asadmin install-jbi-shared-library --port 19048 --user admin --passwordfile passwd.txt ..\addons\jbi-components\<library_to_install>.jar

    NB: If you do not supply a username or password file, but will be prompted to enter these each time you run the command. The port 19048 is the default admin port when a base port of 18000 is used for domain creation.

    To install service engines and binding components from the command line, use:

    asadmin install-jbi-component --port 19048 --user admin --passwordfile passwd.txt ..\addons\jbi-components\<component_to_install>.jar

    The contents of passwd.txt should reflect the passwords entered earlier:


    If you want as close as possible a default CAPS domain installation, install all of the components. To do so, navigate to the .../appserver/addons/jbi-components directory and execute the following:

    asadmin install-jbi-shared-library --port 19048 encoderlib.jar
    asadmin install-jbi-shared-library --port 19048 sharedutillib.jar
    asadmin install-jbi-component --port 19048 bpelserviceengine.jar
    asadmin install-jbi-component --port 19048 filebc.jar
    asadmin install-jbi-component --port 19048 jmsbc.jar
    asadmin install-jbi-component --port 19048 sqlse.jar
    asadmin install-jbi-component --port 19048 xsltserviceengine.jar
    asadmin install-jbi-component --port 19048 etlserviceengine.jar

  6. Modify VM properties in domain.xml

    Locate the domain.xml file in ...\domains\domain2\config and make the following changes to JVM options:
    • Remove the line <jvm-options>-client</jvm-options> under the <java-config> element.
    • Insert the line <jvm-options>-Xms512m</jvm-options> under the <java-config> element.
  7. Install ETL Monitor

    Finally, if you chose to deploy the etl service engine, you should deploy the etlse-monitor.war file also located in the jbi-components folder. From the command line:

    ...\addons\jbi-components> copy etlse-monitor.war ..\..\domains\domain2\autodeploy

    Hands up please those of you who would like to see a new domain manager or special asadmin command to do all of this for you...

I have created a windows batch file for creating a new domain:

:: configuring domain 19000

call C:\JavaCAPS6\appserver\bin\asadmin create-domain --user admin --passwordfile C:\JCAPS6_Install\Documents\passwordfile --portbase 19000 domain_19000

call C:\JavaCAPS6\appserver\bin\asadmin create-stcms --domainname domain_19000 --stcmsport 19007 IQ_Manager_19007

call xcopy/Y/E C:\JavaCAPS6\appserver\domains\domain1\lib C:\JavaCAPS6\appserver\domains\domain_19000\lib

call copy C:\JCAPS6_Install\domain-registry C:\JavaCAPS6\appserver\domains\domain_19000\config

call sc.exe create domain_19000 binPath= "C:\JavaCAPS6\appserver\lib\appservService.exe \"C:\JavaCAPS6\appserver\bin\asadmin.bat start-domain --user admin --passwordfile C:\JCAPS6_Install\Documents\passwordfile domain_19000\" \"C:\JavaCAPS6\appserver\bin\asadmin.bat stop-domain domain_19000\"" start= auto DisplayName= "JCAPS6 DOMAIN_19000"

call net start domain_19000

PING -n 60 > NULL

call C:\JavaCAPS6\appserver\bin\asadmin deploy --port 19048 --user admin --passwordfile C:\JCAPS6_Install\Documents\passwordfile C:\JCAPS6_Install\Deployment_files\19000\TestProject_19000.ear

echo == TestProject_19000.ear
call C:\JavaCAPS6\appserver\bin\asadmin extract-caps-application-configuration --force=true --capsconfigdir C:\JCAPS6_Install\Deployment_files\19000\caps-config C:\JCAPS6_Install\Deployment_files\19000\TestProject_19000.ear

echo == importing environment settting for port 19000
call C:\JavaCAPS6\appserver\bin\asadmin import-caps-configuration --user admin --passwordfile C:\JCAPS6_Install\Documents\passwordfile --host localhost --port 19048 C:\JCAPS6_Install\Deployment_files\19000\caps-config

net stop domain_19000

PING -n 30 > NULL

net start domain_19000

:: END




#Thu Dec 04 10:26:49 GMT 2008

- Ravi