HACP & HATS User Group - Group home

Organizing Web Application Deployment in HATS

  
Host Access Transformation Services (HATS) allows you to transform your user experience by extending 3270 and 5250 terminal applications to the web, portlet, rich client, or as standard SOAP or RESTful web services.  By default, all HATS Web applications are stored in one enterprise archive file.

HATS Toolkit is a HATS component that enables you to develop new applications, previewing, and saving each change. We can streamline the HATS application in such a way that it becomes easier to use the host applications whose data and functions it presents. The supported servers for multiple HATS applications in an ear are ‘WebSphere Application Server’ and ‘WebSphere Liberty’.

This blog describes the ways to manage the HATS web applications that have multiple ‘.ear’ and multiple ‘.war’ in the projects, using HATS Toolkit and the best practices.

When you export your applications as HATS EAR file and deploy them on WebSphere Application Server, the .ear file contains a Web archive (.war) file with the resources to run each application. An EAR may also combine multiple web projects (WAR), Enterprise JavaBeans projects (JAR), standard JARs, etc. into a single application.

Each individual ‘.ear’ consumes around 25MB (minimum) of disk space during runtime. So, if you have multiple HATS projects you may end up having multiple HATS EAR of varying size depending on the complexity of the application. Based on different deployment or development scenarios may lead to developers/administrators opting for single EAR or multiple EAR’s deployment solutions.

The below table illustrates salient points of the ‘Individual’ Vs ‘Multiple wars in single’ EAR deployment method, based on these customers can decide their HATS application deployment architecture.


Described below are the ways to organize the HATS Web Applications:

Associating multiple .war or HATS projects with one ‘.ear’ and de-associating can be achieved using deployment descriptor application.xml present in the META-INF folder of the EAR.
The sections below demonstrate
  • Creating individual ‘.ear’ for each project on HATS Toolkit
  • Adding multiple .war to one .ear in application.xml
  • Removing .war from .ear in application.xml and deploying the same.
 
Creating individual .ear for each project

1. Go to File->New->HATS Project. On the Create a Project console, specify a name for the Enterprise application project (.ear) to be created as shown

2. Click Next and specify connection settings. Click Finish. The created project and EAR in the Navigator are shown

 
3. By default, all HATS Web applications are associated with existing enterprise archive file. Hence the next project will have an ‘.ear’ name same as above HATS_testOne_EAR. We could continue using it.
Or we can provide a different .ear name in step 1: ‘Create project’ dialog which will create separate .ear for the individual project.


After creating individual ears and deploying it on server



Adding multiple .war to one ‘.ear’ in application.xml
1. Initially, there are 4 projects in the workspace


Where project “testFour” is imported as Folder into the workspace

2. Take project ear to which we want to add .war file to, say HATS_testThree_EAR for instance. Expand the META-INF folder to find application.xml. Double click to open the editor.


As we see in HATS_testThree_EAR, “testThree.war” is already present in the Overview section. Let’s add two other .war to it. Say testFour and testOne.

3. So to add .war, click on Add.. button shown on the right side of the Overview. Add Item window pops up. Click on Module and say OK.

4. The next window shows the available modules/projects in the workspace. Add these modules one by one. Click the module and say Finish. Save the application.xml.


  The Overview window will appear as below:

5. Deploy the ear on the server. Restart the server.



Removing .war from .ear in application.xml
1. Select project ear from which we want to remove .war file from, say HATS_testThree_EAR for instance. Expand the META-INF folder to find application.xml. Double click to open the editor.

2. Let us remove testOne.war from the HATS_testThree_EAR. Click on testOne.war in the Overview section and click on Remove button shown on the right side. Save the application.xml
Now the Overview section after removing

3. Deploying the ear on the server. Restart the server.

 

Contact us
For further information on Organizing Web Applications in HATS, automation capabilities and Lab services offerings, please write to:
ZIO@hcl.com

Akshata Betageri
Developer, Lab Services, IBM HACP & HATS