Deploy the App
Here, we'll use Geronimo's deployer to deploy the .war file. Geronimo provides a
deploy command for this purpose. You must provide an administration login (
system/manager) on the command line while deploying. If not explicitly specified, the deployer will ask you for it. The following command deploys the .war file:
D:\>cd %GERONIMO_HOME% D:\geronimo-1.0>java -jar bin/deployer.jar --user system --password manager deploy %GERONIMO_DEV%/dist/safari.war Deployed com/onjava/safari/myApp @ http://WINKJ185011-NZR:8080/myApp
The deployer is smart enough to figure out the kind of component being deployed; we just give it our .war file and the deployer will deploy the file as a Web application. The deployer.jar deploys the application module based on the information provided in the deployment plan (geronimo-web.xml) to the Geronimo server.
Alternatively, you can manually deploy the .war file using Geronimo's console window (as shown in Figure 2). Select the Deploy New link from the Console Navigation panel on the left, browse to the WAR file, and then click the Install button.
Figure 2. Deploy new web app in Geronimo
Once deployed, the web app will appear under the "Installed Web Applications" listing in Geronimo's console window as shown below in Figure 3.
Figure 3. Installed Web Applications
Test the App
All that said, let's cheerily run through it. Start up a browser and try the URL http://localhost:8080/myApp/hello.jsp. The Tomcat web container processes and executes the JSP as shown in Figure 4 below:
Figure 4. Test JSP running on Geronimo app server
Geronimo is modular by nature. This allows easy plugging of modules such as Apache Derby, which ships with Geronimo. Integration of frameworks like Spring is seamless. So, what's holding you up? It's time to give Geronimo a spin.
- Sample code for this article
- Apache Geronimo home
- Download the latest milestone of Apache Geronimo
- Geronimo GBean Architecture
- Geronimo Documentation
- Dependency Injection pattern in Java EE 5
- More information on IoC Containers
Kunal Jaggi is an independent Java consultant, primarily focused on enterprise solutions with Java-based technologies.
Return to ONJava.com.