Java CAPS Tip : Configuring Glassfish to run 5.1.3 Deployments

Following on from my previous entry "Configuring SJSAS For MSMQ XA Transactions" I have put together the following blog entry that updates the information to cover the Glassfish Application Server. Although the procedure is essentially the same as SJSAS 8.2 configuration we loss some of the flexibility associated with managing and monitoring using the Enterprise Manager. Therefore this blog quickly documents the difference and what is required to deploy the generated ear files.


Configuring Glassfish (SJSAS 9.1 U2 Patch 5) For Java CAPS 5.1.3

Configuring Glassfish (SJSAS 9.1) is very similar to configuring the SJSAS 8.2 (Configuring SJSAS For MSMQ XA Transactions) with the exception that the Java CAPS Enterprise Manager will not work with Glassfish. Therefore to facilitate Deployment / Undeployment of the generated ear you will need to use either the asadmin command-line or the Glassfish Admin console (http://localhost:4848).

This section takes you through the required modifications and installations required to run Java CAPS 5.1.3 ear on Glassfish. If you need to use JMS then you will need to create a number of connection pools and this is documented in the related blog entry Configuring SJSAS For MSMQ XA Transactions and hence will not be covered here.

The notes within this and the previous blog are based on some sterling work done by our engineering department.

Server Policies

Before we can run the Java CAPS components on Glassfish the domains server.policy file must be modified to add the following:

grant {
    // Java CAPS needs access to the class loader
    permission java.lang.RuntimePermission "getClassLoader";
    // Java CAPS needs custom classloaders in some cases
    permission java.lang.RuntimePermission "createClassLoader";
    // Java CAPS policy requirement
    permission "setPolicy";
    permission "getPolicy";
    permission "getProperty.policy.url.\*";
    permission "setProperty.policy.url.\*";
    // Java CAPS for the SAP eway
    permission java.lang.RuntimePermission "setContextClassLoader";
    // Java CAPS uses the MBeanServer
    permission "\*";
    permission "\*", "\*";
    permission "register";
    // Java CAPS Log4J support (obsolete) (log4j file roll-over needs delete)
    permission "<<ALL FILES>>", "delete";
    // Java CAPS Odette eWay support requires execute permission
    permission "<<ALL FILES>>", "execute";
    // Java CAPS HTTP eWay
    permission java.lang.RuntimePermission "setFactory";
    // Java CAPS tcpip inbound eway added "accept,resolve" to SocketPermission
    // Java CAPS BPEL debugger added "listen" to SocketPermission
    permission "\*", "connect,listen,accept,resolve";
    // Java CAPS needs these permissions so the Bouncy Castle provider can be used
    permission "insertProvider.BC";
    permission "removeProvider.BC";
    permission "putProviderProperty.BC";
    // Java CAPS needs this permission so the JMX remote connector can be used
    permission "getSubject";
    // Java CAPS: Hessian connector for JMX4J for EM; also for BPEL debugger
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    // Java CAPS: for BPEL debugger
    permission "enableSubstitution";
    // Java CAPS: for EM to use SSL
    permission "setHostnameVerifier";
    permission "getSSLSessionContext";
    permission java.util.logging.LoggingPermission "control";
    permission java.util.PropertyPermission "\*", "read,write";   

Connector Modules and Web Applications

In addition to modifying the server.policy file a number of Java CAPS components (rars, jars and wars) need to be installed into the Application Server and they can be obtained from the Respository downloads page.  Using the Glassfish Admin Console deploy the following:
  • Connector Modules
    • logging.rar
    • raunifiedjms.rar

You will need the the raunifiedjms.rar provided with the JMSJCA HotFix 2162933 or later.

Deploying the will throw :

WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: Error while loading connector module.

You can ignore this.


To configure the transaction service using the Administration Console, open the Transaction Service component under the relevant configuration, and set the following values for the transaction properties.

  • automatic-recovery = true
  • heuristic-decision = rollback
  • keypoint-interval = 2048
  • retry-timeout-in-seconds = 600
  • timeout-in-seconds = 0

Also add the following additional properties :

  • disable-distributed-transaction-logging = false
  • xaresource-txn-timeout = 600
  • pending-txn-cleanup-interval = 60
  • use-last-agent-optimization = false


Building Java CAPS for SJSAS Deployment

You can build a CAPS project to be deployed to Sun Java System Application Server by using Sun SeeBeyond Enterprise Designer.

Build Steps

  1. Log in to Enterprise Designer.
  2. In the Project Explorer, create a Project.
  3. In the Environment Explorer, create an Environment.
  4. Right-click the Repository name and click New Environment.
  5. Right-click the Environment, point to New, and click Logical Host.
  6. Right-click the Logical Host, point to New, and click Sun Java System Application Server.
  7. Right-click the Sun Java System Application Server and click Properties.
  8. Set the Integration Server URL property to the URL that you set when you installed Sun Java Enterprise System (for example, http://localhost:4848).
  9. Set the user name and password to what you created when you installed Sun Java System Application Server.
  10. Click OK.
  11. If the Project requires the use of a message server, you can add a Sun SeeBeyond JMS IQ Manager. Right click the newly created Sun SeeBeyond JMS IQ Manager and click Properties.  Set the STC Message Server URL to where the STC Message Server will be running (for example, stcms://localhhost:18007). For detailed information on how to configure the message server, see the Sun SeeBeyond eGate Integrator JMS Reference Guide.
  12. Click OK.
  13. In the Project Explorer, create a Deployment Profile.
  14. Click Automap to automatically map the components. You can also map the components manually.
  15. Click Build. A dialog box indicates that the project build was successful.
  16. Click OK.
  17. An EAR file will appear in the <JavaCAPS513>\\edesigner\\builds directory (for example,
  18. C:\\JavaCAPS513\\edesigner\\builds\\Project1Deployment1\\LogicalHost1\\SunJavaSystemApplicationServer1\\Project1Deployment1.ear).
  19. To deploy a EAR file, Log into the Admin Console.  Go to Common Tasks->Applications->Enterprise Applications.  Click Deploy. Browse and select the EAR file you have built and click OK.


Wonderful! Thank you very much!

Posted by ioj on December 23, 2008 at 01:23 AM GMT #

Do you think Support might be willing to support this configuration? :)

Posted by ioj on December 23, 2008 at 02:01 AM GMT #

This configuration is not officially supported as such and I suspect that if you have an issue Support will ask if you can reproduce on a standard Application Server (say SJSAS 8.2 or the shipped Integration Server).

Posted by guest on January 06, 2009 at 07:17 AM GMT #

Post a Comment:
Comments are closed for this entry.

As a member of the Oracle A-Team we specialise in enabling and supporting the Oracle Fusion Middleware communities.


« June 2016