...
The following figure illustrates the Web based console.
At this point you have Apache Geronimo up and running and the time spent has been minimal. The following section will propose a very basic sample JSP and show you how to deploy and run that sample application.
...
Although for such a simple application it is not necessary, you we will still create a Geronimo deployment plan so you would get a first view glimpse of the deployment plans. Create a directory named WEB-INF inside the <app_home> directory.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.12"> <environment> <moduleId> <groupId>sample.applications</groupId> <artifactId>HelloWorldApp</artifactId> <version>1.1<2</version> <type>war</type> </moduleId> </environment> <context-root>/hello</context-root> </web-app> | ||||||||
Note | ||||||||
This version of geronimo-web.xml will not work in Geronimo v1.0 |
Create a plain text file in the <app_home>/WEB-INF directory named web.xml and copy the content of the following example.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <welcome-file-list> <welcome-file>HelloWorld.jsp</welcome-file> </welcome-file-list> </web-app> |
Package the application
From a command line window change directory to <app_home> and run the following command to package the HelloWorld application into a single .war file.
jar -cvf HelloWorld.war *
This will create a HelloWorld.war file in the <app_home> directory. The next step is to deploy this applicationFor your convenience, you can download the HelloWorld (HelloWorld_1.2.zip or HelloWorld.war) sample application provided with this article.
Deploy and test the application
To deploy For this example we will not invest time in packaging the application you have two options, you can use the Geronimo Console or the command line. For this example you will use both.
Through the console
Log into the Geronimo console and click on the Deploy New link of the Applications folder located on the left hand side of the console navigation panel. This will load the Install New Applications window.
Then select and load the HelloWorld.war file into the Archive input box and click install button to deploy application in to the server. Once the application is successfully deployed, the screen will be updated with a successful deploy message. Before clicking the install button, make sure that the "Start app after install" checkbox is enabled.
Through command line, we will just use the --inPlace feature of the deployer tool which allows us to deploy an application from any directory.
Change directory to <geronimo_home>/bin and run the following command:
java -jar deployer.jar --user system --password manager deploy --inPlace <app_home>/HelloWorld.war
Once the application is successfully deployed you should see the following message:
No Format bgColor #000000 borderStyle solid
ED:\geronimo-1.2-Tomcat\bin>java -jar deployer.jar --user system --password manager deploy --inPlace E:\HelloWorld\HelloWorld_1.war2
Deployed HelloWorldsample.applications/HelloWorldApp/1.2/war @
http://localhost:8080/hello
...
This article showed you how simple is to have Apache Geronimo up and running. The overall time for getting the server running should be less than five minutes if you have the prerequisite (Java 1.5) prerequisites already installed. Additionally, this article also showed you how to create, deploy and test a very simple JSP in less than five minutes.