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:

    am-configurator.enabled=false

    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
    caps.domain.name=domain2

    # The admin http or https port
    caps.admin.port=19048


    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
    caps.uddi.install=true

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

    # ----- STCMS -----------------------------------------------------------------
    # If STCMS needs to be installed, change this to true
    caps.stcms.install=true

    ...and uncomment the required operating system for installation, e.g. for Windows:
    caps.stcms.os=win32

    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:

    AS_ADMIN_PASSWORD=adminadmin
    AS_ADMIN_MASTERPASSWORD=changeit

    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...

Comments:

hi louis,

i would rather prefer a tool that takes a domain as a template and does just change all the ports of the runtime modules and copies a domain.
isn't ther any templating in glassfih i have heard some rumors now and then....

three things:
1) why did you backup domain1 since you did not use it`?
2) most of the people i know will have additional install steps with their third party jar installations like DB2 or SAP adapters
3) STCMS server will not work this way if you just install it via your install.properties do you know what exactly is done here? or what it is for? or hast it worked for you?

regards chris

Posted by Christian Brennsteiner on June 23, 2008 at 04:21 PM BST #

Hi Chris,

1) The backup of domain1 is taken purely if you need to restore domain1 at some
point rather than create a new domain from scratch. I'll make this clearer in
my blog.
2) This guide considers a fresh install of a new domain equivalent (well -
almost) to an out-of-the-box domain1. If any JCA adaptors are required or other
post-installation changes have been made to domain1, these will also need to be
manually made to domain2. I like your template suggestion and will see if this
is feasible.
3) I've just checked and you're right - there seems to be a problem with STCMS.
I will review this and get back to you.

Regards,
Louis

Posted by Louis Polycarpou on June 24, 2008 at 05:46 AM BST #

Chris,

I've inserted a step (2) to create the embedded stcms using asadmin. This should solve the remaining problem and I've tested that this now works using this step. You will likely need to start again from step 1.

Regards,
Louis

Posted by Louis Polycarpou on June 25, 2008 at 02:28 PM BST #

Nice work Louis, simple, concise and useful stuff to create Domains, etc. in CAPS6!

Is this covered as clearly in the CAPS6 manuals? :-)

Regis

Posted by Regis Kuzel on June 26, 2008 at 08:22 AM BST #

Unfortunately the whole procedure is much more complex than the past one. I am sorry to say it will be hard for us to convince customers that the product is improving while it is becoming more and more complex to use. No customer is fascinated by acronyms like JBI but they usually pragmatically look at concrete features.
Anyway nice work, at least I have now a clear procedure to follow.

Regards

Posted by Maurizio on June 27, 2008 at 01:24 AM BST #

Maurizio,

This specific procedure is more complex than it used to be in CAPS 5.1.x but that can and I'm sure will be addressed and is a small short-term price to pay for the huge benefits that CAPS 6 brings. Sun now has a product that is not tied in to a specific version of the NetBeans IDE or GlassFish Enterprise Server.

I agree with you that customers want concrete features and the JBI standard and work in the open source community has and will continue to really open up the possibilities of the product as more binding components and service engines are developed and supported. Perhaps you can email me what you specifically believe is more complex and we can try to address those concerns.

Regards,
Louis

Posted by Louis Polycarpou on July 01, 2008 at 05:08 AM BST #

Hi Louis,
I just ran across this posting after trying to figure out how to create a new domain. Thanks for posting the info.

My 2 cents - it needs a domain manager tool as in 5.1.3. Simpler is better, less chance of screwing something up. STCMS should probably be installed by default (or at least an option at install time) as I would bet many folks like me are customers looking to do an upgrade. At a minimum, a well documented procedure should be included in the product docs. The install docs are weak IMO.

Off topic but I thought I would mention - It would be fantastic if someone could put together a detailed doc showing the differences/similarities between 6 and 5.1x and 5.0x, and any considerations we need to think about when upgrading. For example, there is a new Sun message queue. When upgrading from 5.0.5, why would I want to use it? Will imported projects work with the new MQ? In the environment I can create a jmsjca. Do I want to use this for some reason? you get the idea.

Thanks, Jeff

Posted by Jeff McCarrier on July 29, 2008 at 03:30 PM BST #

Hi Louis,

thanks a lot for your blog - it really helped me to get my JCaps 6 environment up and running!

Two things to mention from my point of view:
1. It is also necessary to adapt your "install.xml" (to the domainName and Port values defined in install.properties!) before running "asant -f ../addons/caps/install.xml" - this is never explecitly written, so I thought I should mention it here...
2. Is there a simply possibility (script or so) to add the domains created as Windows services?! It makes working a lot easier when those processes would start automatically after a reboot...

Regards
Bernhard

Posted by Bernhard Böhm on July 30, 2008 at 01:19 AM BST #

Hello Louis,

Thank you very much for compiling all these bits and pieces together.
And I'd like to point out two things.

1. The "create-stcms" command isn't listed in the output of asadmin --help.
2. The default domain1 has two JMS providers, Sun_JMQ_7676 and IQ_Manager_18007. But the newly created one (domain2 in this example) has only IQ_Manager_19007 (when viewed from emanager). So... how do I get both JMS providers (the old STCMS one and the new Sun one) into a single domain?

/ioj

Posted by ioj on July 30, 2008 at 01:38 AM BST #

A command in asadmin that will initiate a domain by taking a copy of another (with the ability to override selected options) would be a good approach...
Thinking of the AUTHORIZE COPY/USER command in VMS...

Posted by ioj on August 03, 2008 at 06:14 AM BST #

Hi Jeff,

Thanks for your feedback.

I agree with you that it would be nice to have some scripts to automate this process and I hope we may see that in future updates. STCMS is installed by the CAPS 6 installer if you select to do so. Installing STCMS in this way makes it the default provider for your app server instance so that the default managed resources use STCMS connection pools instead of Java MQ ones.

See the table in the section "JMSJCA MDB applications" in my blog entry at http://blogs.sun.com/polyblog/entry/jms_ha_in_caps_6 for more info on these managed resources and how to use them.

Regarding importing your projects from ICAN / CAPS 5.x to 6, this should be possible in all cases not using XSLT collaborations or eBAM. One thing in your environment that you should be aware of if using STCMS with CAPS 6 is that the default 'short' url - i.e. stcms:// - no longer picks up the default STCMS installed. The reason for this is that it is actually possible to install multiple managed STCMS server instances, and you will therefore need to update your environment to specify the full url - e.g. stcms://localhost:18007 - to point to the exact STCMS server instance that you require.

I've also written up some of the new ways of using JMS in CAPS 6 - such as the Uniform Resource Adapter. See Part 2 of my blog entry on CAPS 6 & Java MQ for more details.

Thanks,
Louis

Posted by Louis Polycarpou on August 17, 2008 at 04:19 PM BST #

Hi Louis,

Just stumbled onto this posting, and I'm very excited. We are pretty new to JCAPS; we've developed on app in 5.1.3, and are now moving to 6. The 5.1.3 app was deployed to a SJAS8.1 environment and we had quite a time discovering what steps were required to make it work with JCAPS. Now that we're moving to JCAPS6 with Glassfish I thought that process would be no longer required. But I discovered that the JCAPS Glassfish is 'modified' to work with JCAPS. Knowing that our operations group will not be rolling out the JCAPS version of Glassfish, but will be using the Sun supplied version, I've been trying to find out what modification we will need to make to that to get it to handle our JCAPS6 applications.

I'm hoping that is what this article is detailing. I'll follow your suggestion to my local installation of the Sun Glassfish and attempt to deploy the simple JCAPS6 JBI application that I have built.

Thanks for posting this,
Dave

Posted by Dave Derry on October 17, 2008 at 07:15 AM BST #

Louis,

I just wanted to post a follow up to let you know that I followed these instructions with a fresh install of Glassfish from Sun, and I was able to deploy a JCAPS6 JBI Composite Application. When I dropped a file into the input directory the application processed as planned.

Thanks, I now feel much better about being able to deploy our JCAPS6 applications once the operations group makes the move to Glassfish.

Dave

Posted by Dave Derry on October 21, 2008 at 12:33 PM BST #

Louis,

A question on asadmin then, which I think was asked earlier but not clearly answered. Is the asadmin create-domain template option still valid in 6?

Thanks.

- Tom

Posted by Tom Jodway on November 12, 2008 at 01:57 PM GMT #

Hi,
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 127.0.0.1 -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 127.0.0.1 -n 30 > NULL

net start domain_19000

:: END

passwordfile

AS_ADMIN_ADMINPASSWORD=admin
AS_ADMIN_MASTERPASSWORD=changeit
AS_ADMIN_PASSWORD=admin

domain-registry

#Thu Dec 04 10:26:49 GMT 2008
am-configurator.enabled=false

- Ravi

Posted by Ravi on December 19, 2008 at 04:35 AM GMT #

for a fresh v6U1 env:

/appserver/bin>asadmin install-jbi-shared-library --port 19048 ../addons/jbi-components/wsdlextlib.jar
/appserver/bin>asadmin install-jbi-shared-library --port 19048 ../addons/jbi-components/encoderlib.jar
/appserver/bin>asadmin install-jbi-shared-library --port 19048 ../addons/jbi-components/saxonlib.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/bpelserviceengine.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/edmse.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/etlserviceengine.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/iepserviceengine.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/xsltserviceengine.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/databasebc.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/filebc.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/ftpbc.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/jmsbc.jar
/appserver/bin>asadmin install-jbi-component --port 19048 ../addons/jbi-components/ldapbc.jar
/appserver/bin>asadmin.bat deploy --port 19048 ../addons/jbi-components/etlse-monitor.war

Posted by Gucci Paull on February 10, 2009 at 08:07 AM GMT #

Ravi, Have you tested your script against JavaCAPS 6U1?

Thanks
Rory

Posted by Rory on March 05, 2009 at 08:33 AM GMT #

Hi Guys,

the following command does not exist in the solaris asadmin using update1
asadmin create-stcms

is there perhaps an equivalent I can use to get the old STCMS back?

Thanks
Chris

Posted by Christopher on May 20, 2009 at 07:46 AM BST #

Hi Louis,

If you want your new domain to be similar to the original domain that was created during the original JavaCAPS 6u1 install, then you need to use the following create-domain options:

asadmin create-domain --portbase 19000 --savemasterpassword=true --savelogin=true domain2

where

--savemasterpassword=true
will encrypt and save the master password so that you don't have to enter the master password when using asadmin command line.

--savelogin=true
will encrypt and save the admin password in %Userhome%/.asadminpass this will allow the AccessManager to configure itself after the initial start-domain, and therefore eliminate the NullPointerException that occurs during start-domain. Thus no need to change the domain-registry file.

Regards
peterv

Posted by Peter Vaneris on July 13, 2009 at 11:33 PM BST #

Hi Louis,

We are migrating from 5.1.2 to JCAPS 6 Update 1(Repository style). Is it possible to run Glassfish in cluster mode when the applications deployed are repository style?

I know that this is not an issue with JBI style.

Thanks
Rax

Posted by Rax Mistry on July 28, 2009 at 09:30 AM BST #

Hi Louis,

This blog really helped me a lot. Successfully I created & started 4 Domains without issue.

We required multiple domains to deploy for multiple users.

While starting 5th domain, had encountered below problem. Can you please help me to resolve this issue.

Exception....
[#|2009-07-29T21:43:00.139-0500|WARNING|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;_RequestID=340a61b9-6518-4a69-9509-cb5d5c8b196d;|CORE5016: Unexpected error occurred while loading applications
java.lang.NoClassDefFoundError: net/java/hulp/i18n/Logger

Solution has not yet written in Glassfish forum for thi issue (CORE5016).

Please help

Posted by Laks on July 29, 2009 at 09:22 PM BST #

You may see below exception when you attempt to start newly created domain using asadmin
-----
java.lang.NullPointerException
at java.util.regex.Matcher.appendReplacement(Matcher.java:699)
at java.util.regex.Matcher.replaceAll(Matcher.java:813)
at java.lang.String.replaceAll(String.java:2189)
at com.sun.am.AMConfigurator.replace(AMConfigurator.java:1574)
at com.sun.am.AMConfigurator.updateAMConfig(AMConfigurator.java:569)
at com.sun.am.AMConfigurator.main(AMConfigurator.java:399)
at com.sun.am.AMConfigurator.configure(AMConfigurator.java:1879)
...
-----

To resolve this, all you need to do is to locate your .asadminpass (from user home directory, e.g. For Windows C:\\Documents and Settings\\<user_name>)
and add a line with new host+port combination (remember to add a blank line at the end. Also if you use non-default password, substitute the last string with your own base64 encoded password string)
-------------
asadmin://admin@localhost:4848 YWRtaW5hZG1pbg==
asadmin://admin@localhost:<port_of_new_domain> YWRtaW5hZG1pbg==

-------------

Posted by Fei on August 05, 2009 at 12:59 AM BST #

Hi Louis,

This is a wonderful post. I really appreciate the effort put in here.

I am trying to create a new domain on windows 2003 as you mentioned here but couldnt add stcms to domain. The asadmin create-stcms command is not recognized. i also observed that the default domain (domain1) created with full installation doesnt have stcms service in domain. There is no trace of STCMS in domain.xml

I have two versions of JCAPS6 one is on my desk top and other is on my work station. create-stcms works on my desk top but not work station. i am not sure if these two versions are same. Could you help me resolve this? I appreciate your help.

Thanks
Hari

Posted by Hari on September 11, 2009 at 04:50 PM BST #

This is in regards to: Mobilised Operations Management Solution (MOMS) for resolution of trouble tickets: on your weblog.
I was wondering if this implementation is available for download somewhere. I am new to Java Caps and OpenESB and would like to try this application.

Thanks for letting me know.

Posted by ilango gurusamy on October 15, 2010 at 08:51 AM BST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Louis Polycarpou

Search

Categories
Archives
« July 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today