Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

This article is about

Converting applications into Geronimo plugins using GEP

In this section we discuss how to use the Geronimo Eclipse Plugin(GEP) to convert Applications into Geronimo Plugins plugins and install them to back into the server.

We are using use Apache Geronimo v2.2 for this tutorial.We have used and an existing tutorial from tutorial sectionsample application throughout the tutorial. See Stateless Session Bean for application development and deployment . Once done see the illustration in this tutorial to export and import JEE artifacts using the Geronimo Eclipse Plugin.

...

of the application.

Table of Contents

Creating Geronimo plugins

Prerequisites

In order to convert applications into Geronimo plugins, the Geronimo Server must be installed and started. Note that only a Geronimo configuration with file type .car can be exported from a server.

And you must have installed the sample application on the running server.

Creating plugins using GEP

Once done, follow the steps below to export Geronimo plugins using GEP.

  1. Double-click the Geronimo server that you defined will display the Server Editor in the main window, and then select Plugin page.
  2. Click Convert Apps to Plugins button will show a wizard named as Plugin ManagerDouble clicking the Geronimo server will display the Server Editor in the main window. Items for working with the server can be found by clicking the Plugin tab. Clicking on the Convert Apps to Plugins button will show the Plugin Manager wizard that is shown below.



  3. Enter or create a directory name, and then select the create Geronimo plugin radio button. The directory that you defined is a temporary place to save the application and you will have a chance to repository to store exported plugins, and you can make any manual updates there if necessary.



  4. The next page of the dialog wizard contains a drop-down list of all the objects modules that can be converted into Geronimo plugins . Many of the objects in this list are already plugins that are used by the Geronimo on the running server. For example, select the console.dbpool/jdbc_userds/1.0/rarcar from the list.



  5. Selecting Select your application objects (one at a time) and clicking click Next will bring up pages that will allow you to change the attributes in geronimo-plugin.xml file before saving. All the fields on the next two pages are data that will be saved with the plugin and will help with installation.



    • Name
      A human-readable name that will be displayed for this plugin.
    • id
      The globally unique ID for this plugin. This value is determined from the installation in the server you're exporting. This defined during installation of the application to be exported. This value also defines the version number for the plugin, so make sure it's correct.
    • Download Repos
      A list of repositories to check for any dependencies that need to be downloaded. This should be a list of one URL per line, with values such as http://geronimoplugins.com/repository/ and http://www.ibiblio.org/maven2/. Note that the repository this plugin is deployed to should typically be the first one listed.
    • Category
      The category this plugin falls into. Plugins in the same category will be listed together. If this plugin is intended to be listed on geronimoplugins.com then you should use one of the category names there if any of them fit. Otherwise, you can select this freely, or according to the categories acceptable to the repository where you plan to post this.
    • Description
      A description of this plugin. You should use plain text only, with blank lines to separate paragraphs.
    • Plugin URL
      A URL to get more information about the plugin (for example, the plugin home page).
    • Author
      The author of the plugplugin, which may be a person, company, open source project, etccommunity and so on.
    • Geronimo Versions
      An optional list of Geronimo versions supported by this plugin. If no values are listed, the plugin can be installed in any version of Geronimo. Otherwise, you can install this plugin in one acceptable Geronimo version.
    • JVM Versions
      An optional list of JVM version prefixes supported by this plugin. If no values are listed, the plugin can be installed in Geronimo running in any version of the JVM. Otherwise, you can install this plugin in one acceptable JVM version.
    • Dependencies
      A list of JARs or other module IDs Geronimo configurations that this plugin depends on. These dependencies will be downloaded automatically when this plugin is installed. Normally you shouldn't change this list. However, you can move entries from the dependency list to the prerequisite list if the user must install the dependency manually before installing the plugin (for example, for a database pool where a plugin wouldn't does not know what server to connect to). Each entry in this list should use the Unique ID format like the one that is used for this plugin above. You may remove the version number if you 'd like want the plugin to work with any version of the dependency, though that may be risky. Each value should be on a separate line.
    • Obsoletes
      A list of module IDs that this plugin replaces. Those plugins or modules will be removed when this one is installed. That may include previous versions of this plugin if you want installing it to "upgrade" rather than just offering an additional alternative. This should be a list with one module ID per line.
  6. The next page has 2 tables. You can update the data in both the License table and Prerequisite table using the Add, Edit, and Remove buttons.



    • Licenses
      The name of the license that this plugin is covered by. Ideally, it would be prefixed by the class of license, like "BSD – (name)" or "GPL – (name)". Specify whether the license is an OSI-approved open source license. See http://www.opensource.org/licenses/index.php for more information about open source licenses.
    • Prerequisites
      The module IDs of prerequisites for this plugin. These are modules that must be present in the server before the plugin can be is installed. They may be something like a specific web container for a web application (geronimo/jetty/1.0/car) or something like a database pool or security realm that the user must install because the plugin author can't create a value that will be valid in the destination server. You may want to leave out as many segments of the module ID as possible in order to accommodate more users.
      No Format
      (e.g.for example, */mypool/*/* rather than myapp/mypool/1.2/car)

  7. Clicking Click Next on this the page saves , and the plugin and the is saved together with a geronimo-plugin.xml file and returns the user . The wizard goes back to the first page for user to export another plugin.
  8. For saving multiple projects or applications(Optional)To export multiple plugins, repeat the steps above steps. For example, do the same for export ApplicationClient and StatelessSessionEJB, plugins using the same procedure by selecting them from the drop-down listlist.
  9. (Optional) Click Cancel to quit the wizard.

The above process creates an appropriate directory structure in the directory specified by the a maven-like repository with the name specified in Local Plugin Repository field of at the first page of the wizard. A geronimo-plugin.xml files have been file is created for each plugin and the under its /META-INF directory. The top directory of the repository includes a geronimo-plugins.xml that file which keeps track of all the plugins that have been created. The values in these files came from data from fields in the last two pages in of the Plugin Managerwizard.

If you need to update the geronimo-plugin.xml file after savingafterwards, you can edit this file manually. When it is installed in the next step, the updates will be saved.



Code Block
titlegeronimo-plugins.xml
borderStylesolid
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
    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.
-->
<geronimo<ns2:geronimo-plugin-list xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/plugins-1.3">
    <ns2:plugin>
        <plugin><ns2:name>jdbc_userds</ns2:name>
        <name>DBPool Database Plugin</name><ns2:category>Unknown</ns2:category>
        <category>Sample<<ns2:description/category>>
        <ns2:url/>
 <description>This plugin sets up a Derby database pool<<ns2:author/description>>
        <url>http://www.apache.org</url><ns2:plugin-artifact>
        <author>Ashish Jain</author>    <ns2:module-id>
        <license osi-approved="true">The Apache Software License, Version 2.0</license>        <ns2:groupId>console.dbpool</ns2:groupId>
        <plugin-artifact>
        <ns2:artifactId>jdbc_userds</ns2:artifactId>
     <module-id>
                <groupId>console.dbpool</groupId><ns2:version>1.0</ns2:version>
                <artifactId>jdbc%2Fuserds</artifactId><ns2:type>car</ns2:type>
                <version>1.0</version></ns2:module-id>
                <type>rar</type><ns2:geronimo-version>2.2-SNAPSHOT</ns2:geronimo-version>
            </module-id><ns2:dependency>
        <dependency>
            <groupId>org<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
             <artifactId>system   <ns2:artifactId>system-database</ns2:artifactId>
            <version>2.1.1</version>
    <ns2:version>2.2-SNAPSHOT</ns2:version>
              <type>car</  <ns2:type>car</ns2:type>
            </ns2:dependency>
            <dependency>
<ns2:dependency>
                <groupId>org<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
              <artifactId>transaction</  <ns2:artifactId>transaction</ns2:artifactId>
               <type>car</ <ns2:type>car</ns2:type>
            </ns2:dependency>
            <dependency><ns2:dependency>
            <groupId>org    <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <artifactId>j2ee<ns2:artifactId>j2ee-server</ns2:artifactId>
                <type>car<<ns2:type>car</ns2:type>
            </ns2:dependency>
        <source-repository>http://repo1.maven.org/maven2/</source-repository>
	<source-repository>file:/C:/myplugins</source-repository>
      <ns2:obsoletes>
      <obsoletes>
            <groupId>console<ns2:groupId>console.dbpool</ns2:groupId>
            <artifactId>jdbc%2Fuserds</    <ns2:artifactId>jdbc_userds</ns2:artifactId>
            <type>rar</    <ns2:type>car</ns2:type>
        </obsoletes>
    </ns2:obsoletes>
        </ns2:plugin-artifact>
    </ns2:plugin>
<plugin>
    <ns2:plugin>
     <name>Stateless EJB Sample Plugin<<ns2:name>ApplictionClient</ns2:name>
        <category>Sample<<ns2:category>Unknown</ns2:category>
        <description>This plugin installs an EJB Sample</description><ns2:description/>
        <url>http<ns2://www.apache.org</url>url/>
        <author>Ashish Jain</author><ns2:author/>
        <license osi-approved="true">The Apache Software License, Version 2.0</license>
<ns2:plugin-artifact>
            <plugin<ns2:module-artifact>id>
        <module-id>
        <ns2:groupId>default</ns2:groupId>
    <groupId>default</groupId>
            <artifactId>StatelessSessionEJB<<ns2:artifactId>ApplictionClient</ns2:artifactId>
            <version>1    <ns2:version>1.0</ns2:version>
            <type>car</type>
     <ns2:type>car</ns2:type>
            </ns2:module-id>
         <dependency>   <ns2:geronimo-version>2.2-SNAPSHOT</ns2:geronimo-version>
            <groupId>console.dbpool</groupId><ns2:dependency>
            <artifactId>jdbc%2Fuserds</artifactId>
	    <type>rar</type><ns2:groupId>default</ns2:groupId>
        </dependency>
        <dependency><ns2:artifactId>StatelessSessionEJB</ns2:artifactId>
            <groupId>org.apache.geronimo.configs</groupId>
    <ns2:version>1.0</ns2:version>
              <artifactId>openejb</artifactId>  <ns2:type>car</ns2:type>
            <type>car<</type>ns2:dependency>
        </dependency>
    <ns2:dependency>
    <dependency>
            <groupId>org<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
            <artifactId>system-database</artifactId>
    <ns2:artifactId>tomcat6</ns2:artifactId>
        <type>car</type>
        </dependency><ns2:version>2.2-SNAPSHOT</ns2:version>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId><ns2:type>car</ns2:type>
            <artifactId>tomcat6<</artifactId>ns2:dependency>
            <type>car</type>
        </<ns2:dependency>
        <dependency>
            <groupId>org<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
            <artifactId>axis</artifactId>
            <type>car</type><ns2:artifactId>concurrent</ns2:artifactId>
        </dependency>
        <dependency>
 <ns2:version>2.2-SNAPSHOT</ns2:version>
           <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>axis2</artifactId><ns2:type>car</ns2:type>
            <type>car<</type>ns2:dependency>
        </dependency>
    <ns2:dependency>
    <dependency>
            <groupId>org<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
            <artifactId>j2ee    <ns2:artifactId>j2ee-corba-yoko</ns2:artifactId>
            <type>car</    <ns2:type>car</ns2:type>
            </ns2:dependency>
        <dependency>    <ns2:dependency>
            <groupId>org    <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
            <artifactId>openjpa</    <ns2:artifactId>openjpa</ns2:artifactId>
            <type>car</    <ns2:type>car</ns2:type>
            </dependency>
	<source-repository>file:/C:/myplugins</source-repository>
	<source-repository>http://repo1.maven.org/maven2/</source-repository>
ns2:dependency>
            <obsoletes><ns2:dependency>
             <groupId>default</groupId>
   <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
               <artifactId>StatelessSessionEJB</ <ns2:artifactId>openejb</ns2:artifactId>
            <type>car</    <ns2:type>car</ns2:type>
            </obsoletes>ns2:dependency>
      </plugin-artifact>
      </plugin>
<plugin>
 <ns2:dependency>
       <name>Application Client</name>
        <category>Sample</category><ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
        <description>This   plugin installs an App Client Sample</description><ns2:artifactId>axis</ns2:artifactId>
        <url>http://www.apache.org</url>
         <author>Ashish Jain</author><ns2:type>car</ns2:type>
        <license osi-approved="true">The Apache Software License, Version 2.0</license>
	<plugin-artifact>
   </ns2:dependency>
      <module-id>
       <ns2:dependency>
     <groupId>default</groupId>
            <artifactId>ApplicationClient</artifactId><ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
            <version>1.0</version>
    <ns2:artifactId>axis2</ns2:artifactId>
                <type>car<<ns2:type>car</ns2:type>
            </module-id>ns2:dependency>
        <dependency>
    <ns2:dependency>
        <groupId>default</groupId>
        <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
    <artifactId>StatelessSessionEJB</artifactId>
            <version>1.0</version><ns2:artifactId>jasper</ns2:artifactId>
            <type>car</    <ns2:type>car</ns2:type>
            </ns2:dependency>
        <dependency>
    <ns2:obsoletes>
        <groupId>org.apache.geronimo.configs</groupId>
        <ns2:groupId>default</ns2:groupId>
    <artifactId>tomcat6</artifactId>
            <version>2.1.1</version><ns2:artifactId>ApplictionClient</ns2:artifactId>
            <type>car</type>
        </dependency><ns2:type>car</ns2:type>
        <dependency>
    </ns2:obsoletes>
        <groupId>org.apache.geronimo.configs</groupId></ns2:plugin-artifact>
            <artifactId>axis</artifactId></ns2:plugin>
    <ns2:plugin>
        <type>car</type><ns2:name>StatelessSessionEJB</ns2:name>
        </dependency><ns2:category>Unknown</ns2:category>
        <dependency><ns2:description/>
            <groupId>org.apache.geronimo.configs</groupId><ns2:url/>
            <artifactId>axis2</artifactId><ns2:author/>
        <ns2:plugin-artifact>
    <type>car</type>
        </dependency><ns2:module-id>
        <dependency>
        <ns2:groupId>default</ns2:groupId>
    <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>openejb<<ns2:artifactId>StatelessSessionEJB</ns2:artifactId>
             <type>car</type>   <ns2:version>1.0</ns2:version>
        </dependency>
        <dependency><ns2:type>car</ns2:type>
            <groupId>org.apache.geronimo.configs</groupId></ns2:module-id>
            <artifactId>j2ee-corba-yoko</artifactId><ns2:geronimo-version>2.2-SNAPSHOT</ns2:geronimo-version>
            <type>car</type>
        </<ns2:dependency>
        <dependency>
        <ns2:groupId>console.dbpool</ns2:groupId>
    <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>openjpa</<ns2:artifactId>jdbc_userds</ns2:artifactId>
            <type>car</    <ns2:type>car</ns2:type>
            </ns2:dependency>
          <dependency>
  <ns2:dependency>
               <groupId>org <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
              <artifactId>jasper</  <ns2:artifactId>openejb</ns2:artifactId>
            <type>car</type>
        </dependency>
	<source-repository>file:/C:/myplugins</source-repository>
	<source-repository>http://repo1.maven.org/maven2/</source-repository><ns2:type>car</ns2:type>
        <obsoletes>
    </ns2:dependency>
        <groupId>default</groupId>
    <ns2:dependency>
        <artifactId>ApplicationClient</artifactId>
            <type>car</type>
<ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>system-database</ns2:artifactId>
         </obsoletes>
       <ns2:type>car</ns2:type>
            </plugin-artifact>
</plugin>
ns2:dependency>
      <default-repository>http://geronimo.apache.org/plugins/geronimo-2.1/</default-repository>
</geronimo-plugin-list>

Installing Geronimo Plugins

...

      <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>tomcat6</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>concurrent</ns2:artifactId>
                <ns2:version>2.2-SNAPSHOT</ns2:version>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>j2ee-corba-yoko</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>openjpa</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>axis</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:dependency>
                <ns2:groupId>org.apache.geronimo.configs</ns2:groupId>
                <ns2:artifactId>axis2</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:dependency>
            <ns2:obsoletes>
                <ns2:groupId>default</ns2:groupId>
                <ns2:artifactId>StatelessSessionEJB</ns2:artifactId>
                <ns2:type>car</ns2:type>
            </ns2:obsoletes>
        </ns2:plugin-artifact>
    </ns2:plugin>
    <ns2:default-repository>http://geronimo.apache.org/plugins/geronimo-2.2/</ns2:default-repository>
</ns2:geronimo-plugin-list>

Installing Geronimo Plugins

Prerequisites

If you intend to install plugins into the same server that is used to export the plugins, you have to remove the projects and relevant resources from the server firstly.

  • To remove the projects, use Add and Remove item on the right-click list of the server in Eclipse;
  • To remove the resources, the database pool in this tutorial, you can use undeploy command as followed;
    No Format
    bgColor#000000
    borderStylesolid
    
    ./deploy.sh --user system --password manager undeploy console.dbpool/jdbc_userds/1.0/car
    Using GERONIMO_HOME:   /home/jeffchi/Geronimo/g2.2-tomcat6
    Using GERONIMO_TMPDIR: var/temp
    Using JRE_HOME:        /opt/ibm/java-i386-60/jre
        Module console.dbpool/jdbc_userds/1.0/car unloaded.
        Module console.dbpool/jdbc_userds/1.0/car uninstalled.
    
        Undeployed console.dbpool/jdbc_userds/1.0/car
    

Installing the plugins

To install the plugins back into a Geronimo server, follow the steps below:

  1. Select Plugin page and then click Convert Apps to Plugins button.
  2. Enter the name of the plugin repository, and then select install Geronimo plugins radio button.

    Image Added

  3. Click Next to select In the Plugin tab in Eclipse, click Convert Apps to Plugins. Specify c:\y as the plugin repository, and select install Geronimo plugins.
    Image Removed
    From the main page of the Plugin Manager wizard, select the Install Geronimo plugins and click Next.
    Image Removed
    Select all the Geronimo plugins that you want to install on the server.

    Image Added

    • If Installable is false,
    then
    • the plugin cannot be selected. The most common
    reasons
    • reason that a plugin cannot be installed
    are if
    • is that the version of
    the
    • this plugin is already installed on the server or
    if
    • its prerequisites are not
    available
    • met.
  4. Clicking Click Next will to install all selected plugins, and these three plugins will be installed and . After that, a confirmation page will be displayed showing what has comes up showing that the plugins have been installed successfully.