...
plan.xml is generated by building the sample and can be found under ./myphonebook-jetty/target/resources/META-INF/plan.xml to deploy on jetty or ./myphonebook-tomcat/target/resources/META-INF/plan.xml to deploy on tomcat following a successful build of the sample. Shown below is the deployment plan for tomcat.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--> <!--$Rev: 497879 $ $Date: 2007-01-19 12:11:01 -0500 (Fri, 19 Jan 2007) $--> <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"> <dep:moduleId> <dep:groupId>org.apache.geronimo.samples</dep:groupId> <dep:artifactId>myphonebook-tomcat</dep:artifactId> <dep:version>2.1-SNAPSHOT</dep:version> <dep:type>car</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>org.apache.geronimo.samples</dep:groupId> <dep:artifactId>sample-datasource</dep:artifactId> <dep:version>2.1-SNAPSHOT</dep:version> <dep:type>car</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>jasper</dep:artifactId> <dep:version>2.1</dep:version> <dep:type>car</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>tomcat6</dep:artifactId> <dep:version>2.1</dep:version> <dep:type>car</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>openejb</dep:artifactId> <dep:version>2.1</dep:version> <dep:type>car</dep:type> </dep:dependency> </dep:dependencies> <dep:hidden-classes/> <dep:non-overridable-classes/> </dep:environment> <gbean name="DBInitialization" class="org.apache.geronimo.connector.DatabaseInitializationGBean"> <!--<attribute name="testSQL">select * from phonebook</attribute>--> <attribute name="path">PhoneBook.sql</attribute> <reference name="DataSource"> <name>SampleTxDatasource</name> </reference> </gbean> </application> |
Building, Configuring
...
, and Deploying the Application
Source Code
You can checkout the source code of this sample from SVN:
...
Creating and Populating Database
The datasource necessary for this example can be installed using the sample-datasource plugin. Use the administration console to first install this plugin. When you deploy the sample application the necessary database table and entries will be created.
Building
If you choose to install the sample as a plugin it is not necessary to create or populate the database as this will be completed as part of the plugin installation. However, if you prefer to deploy the sample using the generated ear you must first install the sample-datasource plugin. You can use either the administration console plugin portlet or the command line install-plugin to install the sample-datasource. When you later deploy the sample the DBInitialization GBean included in the deployment plan will populate the database.
Building
Use a command prompt to navigate into the myphonebook directory and just give mvn install followed by mvn site command to Use a command prompt to navigate into the myphonebook directory and just give mvn install followed by mvn site command to build. It will create the myphonebook-ear-2.0-SNAPSHOT.ear under the myphonebook folder. Now, you are ready to deploy myphonebook application in the Geronimo Application server .
Deploying the Application
...
using either the plugins generated for tomcat and jetty or the deployment plan that was generated and the ear.
Deploying the Application
As previously mentioned, there are two different ways to deploy the sample application - deployment as a plugin or deployment using the ear and plan.
To deploy the sample as a plugin you should do the following using the Geronimo administration console:
- Scroll down to Plugins from the Console Navigation panel.
- Select Update Repository List to get the repository for the server release in use added
- Select the repository for the geronimo release in use and the click on Show Plugins in selected repository
- Scroll down to the myphonebook plugin for your Geronimo configuration (Jetty or Tomcat) and then select install
To deploy the sample using the ear do the following using the Geronimo administration console:
- First, install the sample-datasource plugin. You can do this as follows:
- Scroll down to Plugins from the Console Navigation panel.
- Select Update Repository List to get the repository for the server release in use added
- Select the repository for the geronimo release in use and the click on Show Plugins in selected repository
- Scroll down to the myphonebook plugin for your Geronimo configuration (Jetty or Tomcat) and then select install
- Scroll down to Deploy New from the Console Navigation panel.
- Load myphonebook-ear-2.1-SNAPSHOT.ear from ./myphonebook-ear/target/ in to the Archive input box.
- Load plan.xml from ./myphonebook-jetty/target/resources/META-INF/ or ./myphonebook-tomcat/target/resources/META-INF/ depending on the target server (jetty or tomcat).
- Press Install button to deploy application in the server.
...