In this tutorial we will illustrate how to assemble a custom server using a application-centric approach from console. Using this approach our application will define on the contents of server. Custom server will be built around our application and will include only the components required by our application. For the application we have used an existing tutorial from tutorial section. Refer Stateless Session Bean tutorial for application development and deployment. Later we will assemble a custom server which will only include functional components required by our application.
Identifying the functional components required by our server
This step is required to identify the various dependencies required by our application. Since we are following an application centric approach we need to find out the various dependencies required by our application.
This is the major work required for our custom server which has been simplified by geronimo administrative console.
- To assemble a server from existing instance of geronimo we need to include Geronimo Plugin Group :: Framework plugin group which is the framework of a functional server and pre-selected by default . Refer Plugins Group section for more information on Geronimo Plugin Group :: Framework.
- To identify the application plugins to be included, in this tutorial they are:
- Web archive plugin default/ApplicationClient/1.0/car
- StatelessSessionEJB plugin default/StatelessSessionEJB/1.0/car
- Datasource pool plugin console/dbpool/jdbc_userds/1.0/car
Information about how to get these plugins, please look into Converting applications into plugins using the Administration Console.
- To create a new database from console, we need to include the plugin group Geronimo Plugins, Console :: System Database(Tomcat), which includes console interface plugin,embeded Derby database plugin and required resource adapter plugins.
This completes the identification of all the functional component(dependencies) required by our application centric custom server.
Assembling a custom server
- Launch the administrative console and select Plugins under Applications.
- Select Assemble a server by choosing Application Centric mode.
- Name the artifacts as suggested: groupId as test, artifactId as TestServer and format as zip or so.
- Next step is to select the functional components we identified. Select Geronimo Plugin Group :: Framework, WAR, EJB and database pool plugins. You also have to select Geronimo Plugins, Console :: System Database(Tomcat) since our application uses derby database and you have to create the database from console. Because application WAR, EJB and database pool plugins are dependent with each other, you are free to choose just one of them and therefore rest of its dependencies will be assembled automatically.
You can also choose the Expert mode to select indivial plugins instead of plugin groups.
- Final list of plugins/plugin groups we have selected are as follows
- Once done select Assemble.
- On the next screen each artifact and its associated properties will be displayed. Select Install.
- Once done you will receive a confirmation message suggesting the success or failure of server assembly. It will also enlist the location of the custom server assembly which by default is <GERONIMO_HOME>/var/temp/assembly.
- The server will be named as
TestServer-1.0-bin.zip. Go to
<GERONIMO_HOME>/var/temp, you will find the package of newly assembled server with minimizing footprint and the fewest components you need only under a folder named after the groupId of the new server, which is test in this case. Unzip the package and start the server.
- Because our Stateless Session Bean uses userdbs,you need to create database and tables as suggested in the tutorial.
This completes our illustration for custom server assembly.