A video desktop demonstration of How to Use the Apache Geronimo Eclipse Plugin is available.
Here we will illustrate the various useful functionalities of GEP. This will include adding server runtime, adding Java runtime, start, stop, deploy, redeploy, undeploy and other functionalities.
Adding Target Server and Java Runtime in Eclipse
- Launch Eclipse. By default JEE perspective will be launched. Select Server tab. Right Click and Select New->Server.
- On the next screen select Apache->Apache Geronimo V2.2 Server. In case you do not see Geronimo in the list follow the steps mentioned in How to install Geronimo Eclipse Plugin v2.2.
- On the next screen select Installed JRE's to install a new Java Runtime Environment.
- This will launch the installed JRE's window where all the installed JRE's can be seen. You can currently see only one installed JRE. Select Add.
- On the Add JRE window select Standard VM. Select Next.
- On the next window Browse to your root directory of Installed JRE.
- Once done you can see JRE home and JRE name field populated. Select Finish.
- Check the box to select newly added JRE. Select Ok.
- On the New Server window select the drop down box and select the newly added JRE.
However for the current illustration we will stick to Java 6.
- Next Browse to the root folder of your Geronimo Server Installation. In case you do not have a server installed select the link as shown in the figure to download geornimo.
- Select Next once you have specified all the artifacts.
- Keep the default values for next 2 windows and select Next. Select Finish. This will create a Geronimo server under Server tab.
This completes the ilustration for adding a server
Start and Stop Server
- Right Click on the Geronimo server instance and Select Start.
- Server will be started and you can see the status changed to Started.
- To stop the server Right Click on the server instance and Select Stop.
Deploy Run Undeploy and Redeploy an Application
To illustrate these functionalities we will add a simple web project and later work with it to deploy/run/undeploy/redploy application.
- Right Click under Project Explorer and Select New->Dynamic Web Project.
- Name the project as Hello World. Select Next.
- Keep the defaults on the next window. Select Next.
- On the Geronimo Deployment Plan window name the Artifact Id as Hello. Select Finish. This will add a web project.
- Expand the project and Right Click on Web Content. Select New->JSP. Name the jsp as index.jsp and Select Next.
- On the next window select Finish.
- In index.jsp add the title as Hello World and in the body add This is my first application on G/GEP. Save the changes.
- Now you are all set to run your first application on Geronimo. Right Click on your project and select Run->Run on Server.
- On the next screen select Apache Geronimo and Select Next.
- You can see Hello World as one of the configured projects. Select Finish. This will DEPLOY your application on Geronimo server.
- Launch a web browser as shown in the figure.
- Run the url http://localhost:8080/Hello World. This sill RUN your application.
- Next modify index.jsp and append Hello World! in the body.
- Once you save the changes, Geronimo server will publish the Web application automatically. Refresh the browser to verify if the changes you made are reflected.
- To UNDEPLOY the application from server. Right Click on Geronimo server instance and select Add and Remove Projects.
- On the next screen select Hello World project and select Finish. This will UNDEPLOY the project from Geronimo.
Launching Geronimo Console and Support
You can also launch Geronimo Console from Eclipse.
- Select your preferences to launch the geronimo console as suggested in the figure. Accordingly geronimo administrative console will be launched in Eclipse Internal browser or an external browser.
- Right click on geronimo server instance and Select Launch Geronimo Console to launch geronimo administrative console.
- Similarly select Geronimo Support. This will launch Apache Geronimo website.
See Configuring your development environment for more information you can operate with GEP.