Thursday, May 11, 2006

Deployment and the TIBCO Administrator

If you have used the TIBCO PortalBuilder product, you will know that the 5.x release is now integrated with the TIBCO Administrator. Deployment of components of the portal, or new JSR 168 portlets is done by creating EAR files and deploying them under the Administrator.

The way deployment works is like this:

  1. The Administrator tells the Hawk agent (not the hma) to deploy the EAR

  2. The EAR is unpacked into a scratch area by the Hawk agent's deploy plugin

  3. The unpacked EAR is examined by the deploy plugin and XML files modified to set up the configuration as was specified in the Administrator console

  4. The unpacked EAR is copied to the nominated web server by the deploy plugin

  5. The nominated web server is restarted

  6. The deploy plugin waits for the server to start


So, to watch the deployment proceed on Unix you need to:

  1. Use nohup to start the Hawk agent so a log file is kept (nohup.out)

  2. Use prstat to monitor the running processes (will show you the start/stop scripts running)

  3. Use tail -f nohup.out on the Hawk agent nohup output to watch the reconfiguration happening

  4. Use tail -f on the server log file (catalina.out for Tomcat, errors for SunONE)


Another key item that you need to do is reset the timeouts for the Hawk agent and the Administrator.

The Hawk agent timeout (i.e. the amount of time the Hawk agent will wait for one the activities it does to complete) is specified in hawkagent.cfg (located in the TRA domain directory).

The Administrator timeout (i.e. the amount of time the Administrator will wait for the Hawk agent to complete) is specified in tibcoadmin_DOMAINNAME.tra (located in the Administrator domain directory).

These two values are in seconds and should be set to something between 600 and 720000. Values higher than 720000 are ignored (and 600 will be used instead.) I use a value of at least 3600.

The other item that is crucial is to know when the hawk agent should be restarted. As the hawk agent (through the deployment plugin) scans files and looks up classes, it must be able to find any classes referenced in the configuration. For example, if you set an authentication wrapper class or other plugin class, this class must be known to the hawk agent, or the deployment will fail. Now, as the hawk agent establishes it's class path and loader essentially on startup, JAR files added to the path won't be found after startup, and modified JAR files won't be re-read.

Basically, you should restart the hawk agent whenever you add a new JAR file to the system.

Finally, the plugin directory PORTAL_HOME/5.1/lib/extensions is not present (by default) in the class path used by Hawk, so any JAR files placed here won't be found. You have to add this directory manually to the hawk configuration:

  • Open the TRA_HOME\domain\DOMAINNAME\hawkagent_DOMAINNAME.tra file for editing.

  • In the java properties section, add the following to the tibco.class.path.extended path:
    PORTAL_HOME/5.1/lib/extensions.

  • Restart the Hawk agent.


If you get all of the above right, then deployment should just work for you!

No comments: