Converting applications into Geronimo plugins using GEP
Skip to end of metadata
Go to start of metadata

This article is about how to use the Geronimo Eclipse Plugin(GEP) to convert Applications into Geronimo plugins and install them back into the server.

We use Apache Geronimo v2.2 and an existing sample application throughout the tutorial. See Stateless Session Bean for development and deployment of the application.

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 Manager.



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



  4. The next page of the wizard contains a drop-down list of all the modules that can be converted into Geronimo plugins on the running server. For example, select the console.dbpool/jdbc_userds/1.0/car from the list.



  5. Select your application objects (one at a time) and click Next will bring up pages that 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 defined during installation of the application to be exported. This value also defines the version number for the plugin.
    • 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 plugin, which may be a person, company, open source community 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 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 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 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 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. For example, use /mypool//* rather than myapp/mypool/1.2/car.
  7. Click Next on the page, and the plugin is saved together with a geronimo-plugin.xml file. The wizard goes back to the first page for user to export another plugin.
  8. (Optional)To export multiple plugins, repeat the steps above. For example, export ApplicationClient and StatelessSessionEJB plugins using the same procedure by selecting them from the list.
  9. (Optional) Click Cancel to quit the wizard.

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

geronimo-plugins.xml

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;
    ./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.



  3. Click Next to select the Geronimo plugins that you want to install on the server.



    • If Installable is false, the plugin cannot be selected. The most common reason that a plugin cannot be installed is that the version of this plugin is already installed on the server or its prerequisites are not met.
  4. Click Next to install all selected plugins. After that, a confirmation page comes up showing that the plugins have been installed successfully.
Labels
  • No labels