Utility Tools
CHAPTER 15
To make your J2EE application available to users, you deploy the archive on a J2EE server. This chapter describes how to deploy J2EE archives using the Novell exteNd Director development environment and includes the following topics:
The exteNd Director development environment provides built-in support for deploying archives to the following J2EE servers:
See the Novell exteNd Release Notes for the latest information on the supported server versions.
NOTE: IBM WebSphere does not provide built-in support for direct deployment. You must use WebSphere's deployment tools.
To deploy the archives you generate in the exteNd Director development environment, you can use the following:
When developing, testing, and refining your application, you want fast turnaroundyou want to make a change to your application and immediately see the result without having to redeploy the application. The exteNd Director development environment lets you do this using rapid deployment. You specify rapid deployment by simply checking a checkbox in the Deployment Settings dialog (described in Creating deployment settings). When you deploy the application, this uses the target server's native file system deployment facilities.
Rapid deployment is most useful for changes to Web applications that involve JSP pages, HTML pages, images, JARs in the WEB-INF\lib, or classes in the WEB-INF\classes directories. If you make changes to other application components (such as a WAR tag library or a deployment descriptor), exteNd Director automatically performs a full deployment.
For more information about setting up a rapid deployment environment, see Creating deployment settings. For more information about the target server's native file system deployment, see What happens when you deploy.
exteNd Director can only support rapid deploy if this feature is supported by the application server vendor. The following table lists the J2EE servers that support a rapid deploy feature and the kind of archives that you can rapid deploy.
Server |
EAR |
WAR |
EJB |
CAR |
RAR |
---|---|---|---|---|---|
Novell exteNd Application Server SilverStream eXtend Application Server |
Yes |
Yes |
No |
No |
No |
BEA WebLogic |
Yes |
Yes |
Yes |
No |
No |
Apache Tomcat |
No |
Yes |
No |
No |
No |
When you've completely tested your application and are ready to put it into production, you can deploy the application to the server by unchecking the rapid deploy checkbox in the deployment settings for the target server. exteNd Director uses the target server's native deployment tools to deploy the application in the appropriate production deployment directory.
Alternatively, you can take your generated archives and deploy them outside of the exteNd Director development environment, using instead the deployment facilities provided by your J2EE server. That's because exteNd Director generates standard J2EE archives.
To deploy a J2EE archive using the exteNd Director development environment, the archive must:
Be properly structured according to the J2EE specification (see Archive contents)
Reside in a project (see Projects and Archives)
You must supply:
A server profile (see Server profile)
Server-specific deployment information (see Server deployment information)
Deployment settings (see Creating deployment settings)
The development environment requires:
Permission to write temporary files when deploying to a Novell exteNd Application Server or SilverStream eXtend Application Server
exteNd Director invokes SilverCmd, which generates temporary files on disk. These files are created in the server's installation directory, unless you have defined a HOME environment variable. If you have a HOME variable defined, it must point to a reachable and writable location. The temporary file location is:
Server |
Home environment variable |
---|---|
Novell exteNd Application Server |
NOVELL_EXTEND_APPSERVER_HOME\.appsrv |
SilverStream eXtend Application Server |
SILVERSTREAM_HOME\.silverstream |
When all of these requirements are met, see Deploying a project.
Sun's J2EE specifications define how different J2EE archives must be packaged for deployment. Before you try to deploy, make sure that your archive meets these requirements. The following table briefly lists the requirements. For more detailed information, see the J2EE Blueprints at: java.sun.com/j2ee/docs.html.
J2EE module |
Standard archive requirements |
---|---|
Application client |
A JAR file containing: |
EAR |
An EAR file containing: |
EJB JAR |
A JAR file containing: |
RAR |
A RAR file containing: |
WAR |
A WAR file containing: |
For more information, see J2EE Deployment Descriptor DTDs.
Each J2EE server needs runtime information, and each has its own format for this information. The following table lists the deployment documents needed by each supported server:
J2EE server |
Archives |
Server deployment information |
---|---|---|
Novell exteNd Application Server SilverStream eXtend Application Server |
Application client (CAR) EAR EJB RAR WAR |
Each type of archive uses an XML-based document called a deployment plan. The deployment plan can have any file name and can reside in any location outside the archive file. The server defines a DTD for each archive type.
You use the Deployment Plan Editor to create and populate the deployment plan.
|
BEA WebLogic |
Application client EAR EJB RAR WAR |
Each type of archive (except EAR) requires a special XML-based document. The EAR does not require a specific deployment document, but each individual module included in the EAR must have the appropriate WebLogic deployment document.
|
Apache Tomcat |
WAR |
No specific file is needed. |
When specifying server deployment information, you can override information in your J2EE deployment descriptors, enabling you to customize a particular deployment as needed.
Before you can deploy a project, you need to define the project's deployment settings. They provide information about the server where you plan to deploy the project.
To create deployment settings:
Choose Project>Deployment Settings.
NOTE: If you are deploying to an exteNd application server and the project's current deployment plan is not associated with a server profile, you will be told that you need to specify one in the Deployment Settings dialog.
In the Server Profiles tab, specify the following information:
Option |
What to do |
---|---|
Profile name |
Select a server profile from the list or click New to create a new profile.
|
Use this server profile as the default for all projects |
Select this option to make the current server profile the default profile in new projects. |
User name and Password |
If you have a secure server, fill in the User name and Password text boxes with an authorized user name and password for the server. |
Specify the following for servers that support rapid deployment:
Option |
What to do |
---|---|
Enable Rapid Deployment |
Check this box when you want to deploy the archive using the rapid deployment feature for testing. Uncheck it when you want to do a production deploy. What happens When this checkbox is checked, exteNd Director writes files to the rapid deployment directory specified in the server profile. NOTE: If you have not set a rapid deployment directory in the server profile, you are prompted for one. This directory is a location on disk where you want the server to write the deployment files and is defined by the application server vendor. Many servers require a specific directory; see Server profile for the list. Further action exteNd Director manages updates to the deployment area on subsequent rapid deploys. You do not have to do any manual procedure (as you would have to when directly using the server's rapid deployment). When to use Use rapid deployment during the development/test/refinement stage of your application development cycle. Do not use it when you deploy your application to a production environment.
|
Specify server-specific information.
For Novell exteNd application servers and SilverStream eXtend application servers, specify the following:
Option |
What to do |
---|---|
Deployment Plan |
Specify the file name and disk location of the deployment plan. |
Overwrite existing deployment |
Check this box when you want the current deployment to overwrite any previously deployed objects of the same type and name. If you deselect this box and objects of the same name and type already exist on the server, the deployment will fail. |
Verbosity |
Specify the level of informational messages to display. Values range from 0 (for no messages) to 5 (for the most messages). |
Ignore JSP compile errors |
Applies only to WARs and to EARs containing WARs. Check this box when you want the deployment to ignore any errors when compiling JSP pages and to deploy only those items that build successfully. If this box is not checked and a compile error occurs, deployment fails. |
SilverCmd Flags |
(Optional) Specify command-line arguments for the deployment command.
If you specify multiple arguments, use spaces as the delimiters. If you want to pass VM arguments, you must precede them with +. For example: +Xmx256 All of the values entered here are appended to the end of the deployment command that gets constructed. |
For BEA WebLogic servers, specify:
Click OK to store the deployment settings with the project file.
Any archive that you want to deploy must be defined in a project. If you created the archive using another IDE, you must create a project for it before you can deploy it.
Make sure you have the server-specific deployment information in the appropriate format and location for your target server.
For more information, see Server deployment information.
Define the deployment settings for the project.
For more information, see Creating deployment settings.
Select Project>Deploy Archive.
NOTE: The deployment fails if your server is not running.
When you deploy a project, exteNd Director uses the deployment settings to determine the J2EE server. Then:
It compiles the Java files and creates an archive. (JSP files are compiled during deployment or when their URLs are invoked from a browser.)
When the compilation is successful, it calls the appropriate deploy command for the target server.
The following table lists the deploy command that is called for each server:
The target server's deployment command creates the appropriate deployment objects on the target server.
exteNd Director displays a message stating the status (success/failure) or any warning/error messages in the Output tab of the Output Pane.
When you create a Web Service in the exteNd Director development environment by using the Web Service Wizard or by using the Novell exteNd Web Services SDK directly, a servlet is generated to handle access to that Web Service (from HTTP SOAP requests). As a result, a WAR is required to package your Web Services (one or more per WAR) for deployment to a J2EE server where they will run.
You deploy that WAR in the usual way (as described earlier in this chapter). In addition, you must make sure it has runtime access to the archives required by the Web Services SDK:
For a list of the JARs required by |
See |
---|---|
A Web Service |
Preparing to generate in the chapter on Generating Web Services |
A Web Service consumer |
Preparing to generate in the chapter on Generating Web Service Consumers |
How you set up this access depends on the type of J2EE server you use:
If you deploy to one of the following servers, you must add the required JARs to the server's classpath. (Consult your server documentation to learn about adding to the classpath.)
If you deploy to the Novell exteNd Application Server or SilverStream eXtend Application Server there's no need to add the required JARs to the server's classpath as long as you include them in the WEB-INF/lib directory of your WAR. If you don't include the required JARs in the WAR, you must add them to the server's AGCLASSPATH environment variable or specify them with the classpathJars deployment plan element. (For more information about AGCLASSPATH and classpathJars, see your server's help.)
You can obtain the required JARs by copying them from the Novell exteNd tools\compilelib directory.
Depending on the deployment server, you can disable or delete deployed archives on the server from within the exteNd Director development environment.
exteNd Director doesn't directly perform the undeployment; it calls server facilities to do the work. So, for example, if a server supports deletion but not disabling of archives, then you can delete but not disable archives from the development environment.
Typically, disabling leaves the files on the server but makes them unavailable, and deleting physically removes the files from the server. However, since exteNd Director simply executes the server's undeployment facility, exactly what happens depends on the server. For example, undeploying an application that had been deployed with rapid deployment does not necessarily delete or rename the deployment directory; the server might just delete the references to that application from its metadata. See your server documentation for information about exactly what happens when you undeploy an archive.
Here's a summary of the server undeployment support provided in the exteNd Director development environment:
With the project open, select Project>Undeploy Archive.
NOTE: The menu item is disabled if the deployment server does not provide an undeploy feature.
The dialog that displays depends on the type of server specified in your project's deployment settings:
If your deployment server supports both disabling and deleting archives, you are asked which action you want to perform
If your deployment server supports only disabling archives, you are asked to confirm the disabling action
If your deployment server supports only deleting archives, you are asked to confirm the deletion
The archive is either disabled or deleted. You can see the commands issued by looking in the Output tab of the Output Pane.
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...