Configuring and Using Tomcat Deployer with Studio
Overview
This chapter is for developers familiar with Apache Tomcat Application server version 4.1, and would like to deploy their applications using Tomcat. Studio provides tight integration with Tomcat server. It automatically creates the deployment descriptors while the application is being developed, and keeps the application in a ready-to-deploy state. Studio provides support for deploying applications on local and remote server. The following functions can be performed inside Studio:
- Starting or stopping the server
- Deploying, undeploying and redeploying applications
This chapter discusses how to develop EJB 1.1 and EJB 2.0 applications in Studio and deploy them on Tomcat.
Configuring Tomcat deployer
To configure Tomcat in Studio:
- Download Jakarta Tomcat software.
- Enable the ROOT context.
- Enable the invoker servlet.
- Tell Tomcat to reload servlets when they are modified.
- Setting the JAVA_HOME variable.
- Changing the DOS memory settings.
- Setting the CATALINA_HOME variable.
Creating Tomcat server instances
To create an instance for Tomcat 5.0 server, select Tools > Server Configuration from the main menu. In the Server Configuration dialog, click New. In the Add New Server dialog, enter the following information:
- Server Name: Enter the name of the server instance that is to be created in the dialog
- Server Type: Select the type of the server from the list in the combo box as Tomcat
Press OK to create a server instance and display the Server Config panel. Configure Tomcat properties as:
- Server Name: The Server name is automatically selected as the name entered in the Add New Server dialog. To select another server instance that is to be configured, choose from the list in the combo box
- Type: The server type is displayed as the type selected in the Add New Server dialog
- Naming Port: Enter the port number on which server has been configured to listen to orb requests
- HTTP Port: Enter the port number on which server has been configured to listen to http requests
- Installation dir: Enter the installation directory of Tomcat server in this field. The directory entered here must be the parent directory of \bin, which was created when the server was installed. For remote server, enter the local installation directory of Tomcat. For example, D:\Tomcat\AppServer
- IP address: IP or hostname of the Tomcat server
- Cell name: Name of the cell. The cell name is the host name by default
- Node Name: Name of the node on which application will be deployed. The node name is host name by default
- Server: Name of the server
- Process: Specifies the runtime characteristics of a server process such as, JVM settings, errors, and application paths
- MBean Port: JMX connector port. SOAP connector port for administration is set by default
Note: Studio connects to server through a JMX SOAP connector as the value can not be set as RMI connector
- Enable Security. When the installation dir is entered, and security is enabled, the Trust store files, Trust store p/w, Key store file, and Key store p/w fields are filled, automatically. The default values can be changed as per requirement
- Admin Port: Port number for Tomcat administration console
Click OK to add the instance. To delete an instance, select the required server from Server Name field dropdown and click Delete.
Starting & Stopping Tomcat server
After creating the server instance in Studio, close the Server Configuration panel, and select the instance from the Server Box in the Status Bar. Selecting the Tomcat server instance here makes it the current server, and all server specific operations for the active desk is performed on the current server.
The Tomcat server instance can be started and stopped in a similar way as any other server in Studio. Use Tools > Start Server to start the Server. To stop a server, use Tools > Stop Server from the main menu. The Server can also be started/stopped using the Signal Box.
Note: Remote server cannot be started or stopped from Studio.
Deploying applications on Tomcat
Local deployment
The option Deploy, available on a right click on the Desk Root is disabled when the selected server is Tomcat. In such cases, deploy the desk using any of the following options:
- Deploy the desk as ear or
- Export the desk as an enterprise archive first, and then deploy the archive
If you add a new module to the desk, the entire desk should be deployed again as an ear.
Adding datasources
Studio enables to add resources to Tomcat server from within Studio. Select Tools > Resources to open the Resource Tool and add required resources. For details, read `Defining Resources for Application'.
Log messages
For local Tomcat server, all log messages are displayed in the Tomcat tab in the output panel.
Limitations in Tomcat usage
If Studio can not connect to Tomcat server, check:
- Tomcat server is running
- SOAP connector is running
- Classpath is set correctly in runstudio.bat