div.collapsecontent{display:block;}

Express (Distributed operating systems), v8.0 > Develop and deploying applications


Rapid deployment of J2EE applications

The rapid deployment tools extend the mechanism for generating deployment artifacts, packaging the application, and preparing the application to run on WAS v6.0 or later.
Restriction: We can use the rapid deployment tools for packaging applications at J2EE 1.3 or 1.4 specification-levels. However, the rapid deployment tools do not support Java EE 5.0 (or later) nor J2EE 1.2 specification-level. For tools support of deploying Java EE 5 and later modules, you can use the monitored directory starting in WAS V8.0 release. For more details about the monitored directory, see Ways to install enterprise applications or modules and Installing enterprise application files by adding them to a monitored directory topics.

We can use rapid deployment tools to:

  1. Create a J2EE application quickly without the overhead of using an integrated development environment (IDE).
  2. Package J2EE artifacts quickly into an EAR file.
  3. Test and deploy J2EE artifacts quickly on a server.

For example, you can place fully composed enterprise applications (EAR files), application modules (WAR files, EJB JAR files), or application artifacts (Java source files, Java class files, images, XML, or HTML) into a configurable location on your file system, referred to as the monitored directory. The rapid deployment tool automatically detects added or changed parts of these J2EE artifacts and performs the necessary steps to produce a running application on the server.

There are two ways to configure the monitored directory, each performing separate and distinct tasks. We can either specify the monitored directory as a free-form project or as an automatic installation project.

Free-form project

The rapid deployment tools free you from understanding J2EE application structure, as well as having to update and modify basic deployment descriptor information, such as new servlet or EJB entries. Using the free-form approach, you can place in a single project directory the individual parts of the application, such as Java source files that represent servlets or enterprise beans, static resources, XML files and other supported application artifacts. The rapid deployment tools then use your artifacts dropped in this free-form project directory to automatically place them in the appropriate J2EE project structure, generate any additional required artifacts to construct a J2EE compliant application and deploy that application on a target server.

Example

Assume to set up a simple Web application on a server using the free-form approach. You have created the Java source files that implement a group of servlets. In addition, we have created the JSP files, images, and static HTML files to define the application. Using the free-form approach, you simply place all these files together, or one at a time, in the free-form project directory. As J2EE artifacts are placed inside this free-form project, the rapid deployment tools dynamically generate the necessary J2EE project structure and deployment descriptors. For example, the deployment descriptor includes Web deployment descriptor (web.xml). The J2EE project structure includes an enterprise application project, a Web module project, an EJB module project, an EJB client JAR project, and a utility Java project.

The rapid deployment tools detect additions or changes to J2EE artifacts in the free-form project and run a build. As you drop files into the free-form project, the necessary J2EE projects are created, if these projects do not exist. For example, if you drop a servlet source file, a Web project and an Application project is created if these projects do not exist in your workspace. Then the rapid deployment tool maps the artifacts to their correct location in the appropriate project. In this case, the servlet source file is compiled and its compiled class files are copied to MyProjectWeb\WebContent\WEB-INF\classes. The rapid deployment tools then generate or update any additional required deployment artifacts. In this case, the web.xml for the Web project is updated to include a servlet and servlet mapping entry.

The rapid deployment publishes the updated application on the server. If you choose to use the optional earExportPath option that specifies the directory location of the output EAR file, an EAR file is created. If the target server is remote, it generates an EAR file and transfers the EAR to the remote server.

Benefits

The benefits of using the free-form approach are that you can focus on the structure of the application independent of the requirements of J2EE or other standards. One of the complexities of J2EE development is that it defines the location of artifacts in an application relative to one another. For example, in a Web application, class files must be placed in WEB-INF/classes and JSP files must be placed outside of the WEB-INF folder. This structural requirement must be understood and followed during development in order for the application to operate correctly. The rapid deployment tools remove this structural requirement, allowing the source project to follow your development defined structure and freeing you from having to understand the J2EE defined structures.

Automatic installation project

The rapid deployment tools simplify the process of installing, modifying, and uninstalling applications on a server. Automatic installation relies on a single project directory that listens for J2EE compliant applications (EAR files) or modules (WAR, JAR, or RAR files). The rapid deployment tools then deploy the artifacts to the target server.

If you place EAR files in the automatic installation project, the EAR file is automatically deployed to the server. If you delete EAR files from project, the application is uninstalled from the server. If you place a new copy of the same EAR file in the automatic installation project, then the application is reinstalled. If you place WAR or EJB JAR files in the automatic application installation project, the rapid deployment tool generates the necessary EAR wrapper and then publishes that EAR file on the server. For RAR files, a wrapper is not created. The standalone RAR files are published to the server.

Benefits

The benefit of using the automatic installation project is that it frees you from the complexity of administering the application. For example, using wsadmin scripting program or the administrative console to install the application through a multiple-step wizard.

Remember: To go into any of the generated projects, for example, to modify the deployment descriptor, you should not do it here. Switch to a tool designed for such advanced tasks, such as the IBM Rational Application Developer for WebSphere.
Automatically installing applications on WAS v6.0 or later
Constructing a J2EE application from artifacts


Feedback

+

Search Tips   |   Advanced Search