Prepare a HATS project for use as a Web application
Overview
To convert a HATS project into to a WebSphere application...
- Assemble the project into a J2EE application.
- Transfer the application to a server.
Note that the terms "HATS application", "WebSphere application", and "J2EE application" can be used interchangeably to refer to an application created from a HATS project. It is a HATS application because it was developed in the HATS Studio. It is a WebSphere application because it will be installed and run on WebSphere Application Server. It is a J2EE application because it conforms to the J2EE standards.
Assemble the project into an application
To assemble the project into an application, follow these steps:
- Single-click the name of your project in the HATS Project View.
- Click the Assemble HATS Project icon on the main tool bar, or right click the project name and select Assemble HATS Project.
- In the Export window, choose an Enterprise Application project from the drop-down list or type the name of an Enterprise Application project in the Enterprise Application project name field.
- Type the name of a directory and file name in the Destination field (or click Browse and then select a directory and file name).
- If you want to export the project's source files along with the executable files, check the Export source files box. If you include the source files, another developer can extract them from your .ear file. This can make collaboration or service easier, but decide whether it creates a security risk.
- If you have exported this project to this location before, the export process asks whether you want to overwrite the existing files. This is intended to protect you from overwriting files that you might want to keep, perhaps to archive a previous version of your project. If you want to overwrite previous files without being asked for confirmation, check the Overwrite existing resources without warning box.
- Click Finish. The project is assembled into a J2EE application, represented by an Enterprise Archive file with extension .ear, with the directory and file name you specified.
If you use the display terminal or any other trace options in HATS Studio, be sure you turn the functions off before assembling your project for installation to WebSphere Application Server. Otherwise, those functions will be active when you install your application to the server. See the HATS User's and Administrator's Guide for more information.
If you export (assemble) a HATS Enterprise Application project and receive an error dialog named EAR Export Error, refresh each project in the ear file by right-clicking on the project name and selecting Refresh from the context menu, and then export again.
Grouping your applications
You can group your HATS applications together in one .ear file, or store each in its own separate .ear file. These options are discussed in HATS User's and Administrator's Guide. Be sure your HATS applications are grouped in the way you want before you install them to WebSphere Application Server.
Install the application on a server
If you created the application's .ear file on your Studio machine, you must move it to your WAS machine. Use FTP, shared network drives, or whatever other method is standard in your environment. After the application's .ear file is on your WAS machine, ask your WAS administrator to install it as a WebSphere application, using the administrative console and the steps described in the WAS InfoCenter. Once the application has been installed, test it by bringing up the URL in a Web browser on another computer. Then you can publish the URL to your users.
Notes:
- Graphing support on iSeries servers requires additional iSeries software and configuration. See Appendix A. Enabling graphing support for HATS on iSeries for details on installing and configuring the required software.
- On zSeries, there are some recommended server settings and additions to WebSphere variables. See Appendix B. Running HATS applications on a zSeries Server for details on the server settings and WebSphere variables, as well as information on the required software and configuration for graphing support.
Changes necessary in the server environment
Depending on how you've created your projects, and the functions you have included in them, you might need to make some changes to the server environment in which the project runs. Those changes are discussed in the following sections.
Configure class loader policies
When you install your HATS applications, or when running the applications in the HATS Studio in the Run on Server mode, configure your WAR class loader policy on a per J2EE application basis for any of the following situations:
- If you have more than one HATS application in an .ear file
- If your project connects to a host using secure sockets layer (SSL) security, the connection might not be established, even after the certificate is imported.
- If your project includes business logic, your business logic might cause a ClassNotFoundException to occur.
- If your project includes custom created components or widgets, the components or widgets might cause a ClassNotFoundException to occur.
To change the module visibility in WebSphere Application Server, follow these steps:
- In the WAS Administration console, go to...
Enterprise Applications | Project .ear file- Change the .war class loader policy option to Application
- Click
Apply | Save- Stop and start the Enterprise Application.
To change the module visibility in WebSphere Studio, follow these steps:
- Click...
Window | Show View | Other | Server Server Configuration | OK- In the Server Configuration window, right click on the server you want to modify, and select Open.
- Click on the Applications tab. This opens the Application Options panel.
- Expand Application settings.
- In the Applications list, select the HATS .ear file you want to change.
- On the right side of the panel, change the .war class loader policy setting to Application.
- Save the changes by pressing Ctrl+S.
- Stop the application server if it is running. Do not use Restart because your change will not be applied if you only restart.
- Start the application server.
HATS and Host Publisher V4.0.1 coexistence
If you install HATS on a WebSphere Application Server V5 where you also have Host Publisher V4.0.1 installed, a HAT0300 NoSuchMethodError message might display when running HATS applications. The error occurs because the HATS application uses the habeanslnv.jar file installed in the WebSphere \lib\ext by Host Publisher, rather than the habeanslnv.jar file defined by the HATS application. By default, WebSphere searches for .jar files in \lib\ext first.
Use WebSphere administration to set the class loader policy for the HATS application so that classes defined in the HATS application are used before classes defined outside the application. To set the class loader policy in WebSphere administration, follow these steps:
- In the left pane, click the plus sign (+) to expand Applications.
- Click the Enterprise Applications link.
- In the right pane, click the link for your HATS application.
- On the Configuration tab, locate the Classloader Mode. Change the mode to PARENT_LAST.
- Click Apply.
- A message tells you to save the changes to your configuration. Save the changes.
- Return to the Enterprise Applications.
- Stop the application.
- Restart the application.
If you continue to receive the HAT0300 NoSuchMethodError message, stop and restart the application server where the HATS application is installed.
Home