J2EE Applications in Dynamo 5.5
Summary
This article goes through the steps to deploy a simple "Hello
world" j2ee application. The application consists of a single helloworld.jsp
file:
<HTML>
<TITLE>Hello World!</TITLE>
<BODY>
<H1>Hello There!</H1>
<P>Today's date is <%= (new Date()).toString()%></P>
</BODY>
</HTML>
Instructions
The instructions are based on the ATG training course lab instructions
provided by ATG's talented curriculum development team.
- Start Dynamo 5.5 and the ACC
- Login to the localhost port 8860 with the ACC (admin/admin)
- Select Tools from the ACC menu
- Select J2EE Deployment

- Select Create New J2EE Application from the File menu
- Fill in HelloWorldProject and HelloWorldApplication

- Double-click the HelloWorldApplication under the HelloWorldProject

- Click Web Modules in the tree view
- Enter web-app as the Web Module Name
- Click Create Empty Web Module:web-app.war, to create the web
application archive...

- Click on web-app.war, choose the Server tab, and enter hello
as Context Root. This string will form the basis of the URLs used to access
your application. So that http://localhost:8840/hello
will map to the root of your web application. This has to be unique amongst
all the applications on the server so they don't fall over each other.
- Add a new helloworld.jsp file to your web application. To do this create
the file in the web application folder on your dynamo machine. In our case
this will be:
C:\ATG\Dynamo5.5\HelloWorldProject\j2ee-apps\HelloWorldApplication\web-app.war
This is actually a folder not a file! Also notice where our J2EE project and
application names figure in this path name: HelloWorldProject is the Dynamo
module name and HelloWorldApplication is a j2ee application within that
module.
Once you have the file, copy the JSP code listed
at the top of this document into it and then save the file.
- To tell the server that helloworld.jsp is the default page for this
application, add helloworld.jsp to the Welcome File List, thus:
,
- Save the configuration: Select File -> Save Current
Configuration
- Build the application: Select Tools -> Build Application.
This validates everything and ensures that all the application dependencies
are resolved (We don't have any). If there are no errors you should see the
following:

- Close the output window and start the application in the server:
Select Tools -> Start J2EE Application
- Test the application: Visit http://localhost:8840/hello

- The application is currently running out of the staging directory. To
deploy your application onto another Dynamo you should build the .dar file
and deploy that file. The steps to achieve this are described below. Only do
this once you have 'finished' you application.
Deploying your application on another Dynamo
- Open your J2EE application in the ACC
- Build a Dynamo Archive (the .dar) file: Select Tools -> Save
to Local DAR File.


- Copy the .dar file to the target Dynamo machine
- Connect the ACC to the target Dynamo machine.
- Select Tools from the ACC menu
- Select J2EE Deployment
- Select Install J2EE Application from Local Archive from the File
menu
- Fill in the Project Name, Application Name and browse to select the .dar
file you just copied.
If you are just testing this out on the same machine, enter different
J2EE Project and Application Names than before (e.g.
DeployedHelloWorldProject and DeployedHelloWorldApplication):

- Double-click the new DeployedHelloWorldApplication under the
DeployedHelloWorldProject
- If you are deploying on the same server as you staged the application...
Rename the application: Click on HelloWorldApplication in the tree
view and change both the Display Name and the Dynamo Application
Name to DeployedHelloWorldApplication. Save the application by
clicking on the disk icon or using the File menu

- Select the web-app.war under Web Modules in the tree view.
Check the Context Root on the Server tab. Change it to deployed_hello
if you are doing all of this on the same machine, so you can differentiate
it from the staged version:

- Save the configuration: Select File -> Save Current
Configuration
- Build the application: Select Tools -> Build Application.
This validates everything and ensures that all the application dependencies
are resolved (We don't have any). If there are no errors you should see the
following:

- Close the output window and start the application in the server:
Select Tools -> Start J2EE Application
- Check the ATG screen log for errors:
**** info Mon Oct 01 19:13:25 PDT 2001 1001988805811
/atg/dynamo/service/j2ee/J2EEContainer
atg.j2ee.container.J2EEContainerResources->loadingApplication : Loading
J2EE application from: C:\ATG\Dynamo5.5\DeployedHelloWorldProject\j2ee-apps
\DeployedHelloWorldApplication
**** info Mon Oct 01 19:13:25 PDT 2001 1001988805811
/atg/dynamo/service/j2ee/Darina Stage directory:
C:\ATG\Dynamo5.5\DeployedHelloWorldProject\j2ee-apps\
DeployedHelloWorldApplication
**** info Mon Oct 01 19:13:26 PDT 2001 1001988806001
/atg/dynamo/service/j2ee/Darina Validating configuration
**** info Mon Oct 01 19:13:26 PDT 2001 1001988806021
/atg/dynamo/service/j2ee/Darina Successfully validated configuration.
**** info Mon Oct 01 19:13:26 PDT 2001 1001988806041
/atg/dynamo/service/j2ee/Darina Merging specifier data into base J2EE
configuration.
- Test the deployed application: Visit http://localhost:8840/deployed_hello

- Check out the files you created deploying the new application

There you go! Notice that your staging version is still running fine too,
just under a different context root.
|