17
Application Deployment and Server Mgmt Quickstart Last Revision: October 14, 2004 Outline 1. Preface 2. Introduction 3. Requirements 4. Application Server Connectors 5. Connector Configuration 6. J2EE Project Deployment 1. J2EE Project Deployment Modes 2. Deploying a J2EE Project 7. Application Server Operation and Debugging 1. Launching an Application Server 2. Debugging a Deployed Application 3. Stopping an Application Server 8. User Feedback 1. Preface This document was written using Sun JDK 1.4.2, Eclipse 3.1 and MyEclipse 4.0. All screenshots are based upon the default user interface settings for Eclipse, MyEclipse, and Windows XP. If you experience difficulty with the instruction of this document, please see the User Feedback section for how to provide feedback to the MyEclipse documentation team. Back to Top 2. Introduction MyEclipse Enterprise Workbench provides developers the ability to seamlessly deploy, execute, and test their MyEclipse J2EE applications to any of over 20 different application servers including: JBoss Jetty Jonas JRun Oracle Orion Resin Sun Tomcat WebLogic Server WebSphere

MyEclipse Application Server Quick Start

Embed Size (px)

Citation preview

Page 1: MyEclipse Application Server Quick Start

Application Deployment and Server Mgmt Quickstart

Last Revision: October 14, 2004

Outline1. Preface 2. Introduction 3. Requirements 4. Application Server Connectors 5. Connector Configuration 6. J2EE Project Deployment

1. J2EE Project Deployment Modes 2. Deploying a J2EE Project

7. Application Server Operation and Debugging 1. Launching an Application Server 2. Debugging a Deployed Application 3. Stopping an Application Server

8. User Feedback

1. PrefaceThis document was written using Sun JDK 1.4.2, Eclipse 3.1 and MyEclipse 4.0. All screenshots are based upon the default user interface settings for Eclipse, MyEclipse, and Windows XP. If you experience difficulty with the instruction of this document, please see the User Feedback section for how to provide feedback to the MyEclipse documentation team.

Back to Top

2. IntroductionMyEclipse Enterprise Workbench provides developers the ability to seamlessly deploy, execute, and test their MyEclipse J2EE applications to any of over 20 different application servers including:

• JBoss• Jetty• Jonas• JRun• Oracle• Orion• Resin• Sun• Tomcat• WebLogic Server• WebSphere

Page 2: MyEclipse Application Server Quick Start

MyEclipse interacts with a local application server instance through an application server connector. Each connector is configured through the MyEclipse preferences and provides integrated controls that allow you to:

• Start an application server in Run or Debug mode• Monitor application server operation via stdout log messages which is redirected to the MyEclipse console• Test deployed applications through your custom test client or web browser• Perform hot-swap Java debugging of deployed application code• Perform JSP source-level debugging on JSR-045 compliant application servers such as Tomcat 5.x• Stop the application server

Back to Top

3. RequirementsThe requirements for MyEclipse application server support are:

1. MyEclipse application server connectors require direct access to application server installation. Therefore the application server must be installed on the file system of the machine that MyEclipse will operate. Note: MyEclipse does not currently support application deployment to remote application servers.

2. To support JSP source level debugging, your application server must support JSR-045 specification for debugging of non-Java source code.

3. Hot-swap debugging requires that your application server be launched with a JDK 1.4.x virtual machine. If you are working with an older application server that requires JDK 1.3 debugger, breakpoints will be honored but hot-swapping of modified code in your MyEclipse workbench will not be possible since 1.3 JVM's do not support the JPDA specification.

4. Application server connectors should be configured to launch their respective application server with a full JDK (javac included) environment. Do not use a JRE. The full JDK is required because it provides a Java compiler which is required by all application server to compile JSP pages or dynamically process and deploy EJBs. A full JDK for your platform can be downloaded from Sun Microsystems at http://java.sun.com/j2se/downloads/index.html

5. Only MyEclipse J2EE project types (Enterprise, EJB, and WEB) may be deployed with the MyEclipse Deployment Service. MyEclipse does not support direct deployment of basic Java projects. Please see the Web Project Quickstart for more information on the use of basic Java projects in conjunction with MyEclipse Web Projects and their deployment.

Back to Top

4. Application Server ConnectorsTo begin configuration, open the Application Server Connector preferences dialog from the main Eclipse menubar by choosing Window > Preferences > MyEclipse . In the left panel expand the Application Servers node to view the list of connectors available. Then click on one of the servers to select it for configuration.

Page 3: MyEclipse Application Server Quick Start

Figure 1. MyEclipse application server connector preference pages.

Below is an example of a server configuration page. Please notice that there are a few sub-pages (JDK, Launch, Paths), under each main server preference page, that allow detailed customization of the server startup and operation.

Page 4: MyEclipse Application Server Quick Start

Figure 2. Example JBoss connector configuration page

Back to Top

5. Connector ConfigurationThere are 3 basic steps to configuring an application server connector:

1. Specify application server installation details2. Enable the connector3. Specify the JDK that will be used when launching the application server

Please note that some connectors may require additional configuration details. Consult your specific application vendor for additional requirements.

Step-1: Specify application server installation details

Browse to and select the root directory of your application server installation (See Figure 3). MyEclipse will attempt to prepopulate the remaining connector fields with common default values used by your application server. Figure 4 depicts the default settings for the Tomcat 5 installation at the d:\dev\appservers\Tomcat 5 path.

Page 5: MyEclipse Application Server Quick Start

Figure 3. Initial Tomcat 5 server location details

Page 6: MyEclipse Application Server Quick Start

Figure 4. Default Tomcat 5 server location details

Step-2: Enabling the connector

Selecting the Enable button enables the connector to be used by MyEclipse J2EE project deployment and debugging services.

Page 7: MyEclipse Application Server Quick Start

Figure 5. Tomcat 5 connector enabled

Step-3: Specify the JDK environment to be used for launching the application server

The final configuration step is to specify the JDK installation that the connector will use to launch the application server instance. See requirement #4 for background details for this task. The JDK information is specified on the connector's JDK preference page. Figure 6 illustrates the Tomcat 5 JDK preference page and the JDK selection list highlighted in red. If you have previously configured a JDK installation then select it now from the JDK drop-down list (see Figure 8); otherwise perform Step-3a to configure a JDK installation. The JDK list shown in Figure 6 only lists the default JRE that is used to launch MyEclipse, which is insufficient for supporting the requirements of most application servers. Therefore the sake of this example we must perform Step-3a to complete this connector's configuration.

Page 8: MyEclipse Application Server Quick Start

Figure 6. Tomcat 5 JDK preference page

Step-3a: Defining a new JDK installation for Eclipse

From the connector's JDK preference page select "Add". This will open the Eclipse Add JVM dialog (see Figure 7). Note while the fields of this dialog refer to the a JRE environment our objective is to specify the location of a full JDK as the runtime environment, not the default JRE provided by Sun Microsystems. Do the following:

1. Enter the JRE name 2. For the "JRE home directory" field select Browse... to open a File Browser dialog (not shown)

1. In the File Browser dialog navigate to the root directory of your JDK installation directory, not the JRE directory it contains. Select this directory in the File Browser and enter OK to return to the Add JVM dialog

3. The Add JVM dialog's remaining fields should be prepopulated with default values derived from the value of the "JRE home directory" field

4. Select OK to close the Add JVM dialog and return to the Tomcat 5 JDK preference page

Page 9: MyEclipse Application Server Quick Start

Figure 7. Add JVM dialog

Now select the newly configured JDK from the JDK drop-down list. Figure 8 illustrates selecting the newly defined JDK from Step-3a.

Page 10: MyEclipse Application Server Quick Start

Figure 8. Tomcat 5 JDK preference page with valid JDK selection

Step-4: Accept changes

Lastly, select OK to accept the changes and complete the configuration.

Note: Your application server may require additional configuration steps. Use the additional settings pages and paths to customize the connector's launch configuration as needed. Please review all settings as they will affect the proper launch and operation of your application server.

Back to Top

6. J2EE Project Deployment

6.1 J2EE Project Deployment Modes

MyEclipse can deploy Web, EJB, and Enterprise Application projects to any MyEclipse enabled application server. Two deployment packaging modes are supported by MyEclipse: exploded archive deployment and packaged archive deployment.

Page 11: MyEclipse Application Server Quick Start

• Packaged Archive Deployment - This is the J2EE standard application packaging model for deployment. It consists of packaging an application's resource into a single ZIP archive file with an internal J2EE standard file structure. The resulting single archive file is then deployed to a target application server by application server's connector. Packaged archive deployment does not support incremental or automatic archive update. Thus a package deployment will become out of sync with its source project as edits are made to the project's resources. Periodic redeployment is required to resynchronize a deployed application's state with the latest version of its MyEclipse project source.

• Exploded Archive Deployment - This is a convenient but non-standard J2EE application packaging and deployment model. Similar to packaged deployment, an application's deployable resources are organized to conform to a J2EE standard directory/file structure. But, rather than create and deploy a single archived file, the entire application resource structure - directories and files - is copied by the application server connector to the server's special deployment location for exploded archives. The MyEclipse Deployment Service, using "Sync-on-Demand" technology, will keep all MyEclipse project deployments synchronized with all source changes in their corresponding MyEclipse project. Please note that exploded deployment is not a standard J2EE deployment form and may not be supported by all application servers.

Consult your application server vendor for the modes supported by your application server.

Back to Top

6.2 Deploying a J2EE Project to an Application Server

Step-1: Open Deployment dialog

From the MyEclipse Perspective, launch the Project Deployments dialog (see Figure 9 for the deployer toolbar button).

Figure 9. Deployment toolbar action

Step-2: Select J2EE project to deploy

Select the J2EE project you wish to deploy from the "Project" field drop-down list.

Page 12: MyEclipse Application Server Quick Start

Figure 10. Deployer dialog

Next select the Add... button to open the New Deployment Wizard (see Figure 11).

Figure 11. New Deployment dialog

Page 13: MyEclipse Application Server Quick Start

Step-3: Specify new deployment details

1. Select the desired Deployment Type, Exploded Archive or Packaged Archive. 2. In the Server drop-down list, select the target deployment server. Note that only servers that

support the desired deployment type and project type will be presented as valid choices. 3. If the deployment is Exploded Archive then the Exploded location field will be automatically filled

with the appropriate deployment path, based on the type of server that is selected. 4. Select Finish to initiate the deployment. 5. The New Deployment Wizard will display a progress monitor that describes deployment progress. 6. Upon completion of the deployment the New Deployment Wizard will close and control is returned

to the Project Deployments dialog.

Figure 12. New HelloWorld deployment

Back to Top

7. Application Server Operation and Debugging

7.1 Launching an Application Server

The MyEclipse toolbar provides controls for starting and stooping enabled application server connectors. To launch an application server do the following:

Step-1: Initiate application server start-up

From the MyEclipse toolbar:

Page 14: MyEclipse Application Server Quick Start

1. Select the application server management menu2. Expand the menu to the Start action of your target server and select it (see Figure 13)

The application server connector will launch the application server instance.

After deploying your application to an application server, you can start the server in debug mode to test your new J2EE project deployment.

Figure 13. Starting Tomcat 5 from Application Server Management toolbar

Step-2: Monitor application server start up for problems

The application server connector redirects the application server's stdout and stderr streams to the MyEclipse console. Monitor the console for server start-up problems. Figure 14 depicts a successful startup of Tomcat 5.

Page 15: MyEclipse Application Server Quick Start

Figure 14. Successful Tomcat 5 startup process

Back to Top

7.2 Debugging A Deployed Application

MyEclipse extends the Eclipse debugger platform to support JSP breakpoints and debug actions. Debugging a deployed J2EE application is similar to debugging a standard Java application. From either the Java or JSP source editor you enter breakpoints in the left margin. During application server execution when execution control encounters a breakpoint the Eclipse Debug Perspective is invoked and debug information displayed.

Note: the application server connector's Launch mode must be set to Debug in order for breakpoints to be enabled and execution to halt in a breakpoint context. See the connector's preferences for more details.

Figure 15. JSP debugging session

Back to Top

Page 16: MyEclipse Application Server Quick Start

7.3 Stopping an Application Server

To shutdown an application server do the following:

Step-1: Stopping an application server

From the MyEclipse toolbar:

1. Select the application server management menu2. Expand the menu to the Stop action of your target server and select it (see Figure 16)

The application server connector will begin the shutdown process for the application server instance.

Figure 16. Initiating Tomcat 5 shutdown

Step-2: Monitor application server shutdown for completion

As the application server shuts down you should observe thread termination of the application server's process. In many cases shutdown progress messages from the application server will be output to the MyEclipse console. Figure 17 depicts a successful Tomcat 5 server shutdown. Notice that its threads have been terminated and a shutdown message appears in the console.

Page 17: MyEclipse Application Server Quick Start

Figure 17. Tomcat 5 shutdown completion

Back to Top

8. User FeedbackIf you have comments or suggestions regarding this document please submit them to the MyEclipse Documentation Forum .

Back to Top

Copyright © 2004 - 2005 by Genuitec L.L.C