Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

This topic will take you through plugin transform, export and import by using Apache Geronimo administration console.

We have used an existing tutorial from the tutorial section. Refer See the Stateless Session Bean tutorial for application development and deployment. Once done refer Then use the illustration in this tutorial to export and import Java EE artifacts from Apache Geronimo administration console.

Info
titleClarification

The Application client referred to in this tutorial is actually a Web Application Client.

...

In this section, we will convert an existing applications into a plugin directly via by using the administration console.

  1. Launch the Administrative administrative console and Select select Plugin portlet under Applications on the navigation panel.





  2. Under Create Geronimo Plugin, select jdbc/userds database pool from the drop-down menu.





  3. Once done select Then, click Export Plugin.





  4. On the next page, keep all the values default and Select click Saving Plugin Data.





  5. On the next screen select , click Done to convert the resource pool archive into a plugin directly.





  6. Similarly, convert ApplicationClient and StatelessSessionEJB into plugins.


...

Exporting the application as a plugin

  1. Launch the Administration administration console and Select select Plugin portlet under Applications on the navigation panel.





  2. Under Create Geronimo Plugin, select jdbc/userds database pool from the drop-down menu as shown in the figure.





  3. Once done select Then click Export Plugin.





  4. On the next page, keep all the values default and Select click Saving Plugin Data.





  5. On the next screen select , click Export Plugin.





  6. A window will pop-pops up suggesting to save the plugin. Select click OK.





  7. Similarly, export ApplicationClient and StatelessSessionEJB as a pluginplugins.








Create a custom repository from Geronimo Administrative Console

  1. Create a folder say , for example myplugins, in your hard drive.
  2. Copy the exported plugins to this directory.
  3. Next create a geronimo-plugins.xml which will enlist all the plugins in our repository.
    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-plugin-list xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
                <plugin>
            <name>DBPool Database Plugin</name>
            <category>Sample</category>
            <description>This plugin sets up a Derby database pool</description>
            <url>http://www.apache.org</url>
            <author>Ashish Jain</author>
            <license osi-approved="true">The Apache Software License, Version 2.0</license>
    
            <plugin-artifact>
                <module-id>
                    <groupId>console.dbpool</groupId>
                    <artifactId>jdbc%2Fuserds</artifactId>
                    <version>1.0</version>
                    <type>rar</type>
                </module-id>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>system-database</artifactId>
                <version>2.1.1</version>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>transaction</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>j2ee-server</artifactId>
                <type>car</type>
            </dependency>
            <source-repository>http://repo1.maven.org/maven2/</source-repository>
    	<source-repository>file:/C:/myplugins</source-repository>
            <obsoletes>
                <groupId>console.dbpool</groupId>
                <artifactId>jdbc%2Fuserds</artifactId>
                <type>rar</type>
            </obsoletes>
            </plugin-artifact>
        </plugin>
    <plugin>
            <name>Stateless EJB Sample Plugin</name>
            <category>Sample</category>
            <description>This plugin installs an EJB Sample</description>
            <url>http://www.apache.org</url>
            <author>Ashish Jain</author>
            <license osi-approved="true">The Apache Software License, Version 2.0</license>
        <plugin-artifact>
            <module-id>
                <groupId>default</groupId>
                <artifactId>StatelessSessionEJB</artifactId>
                <version>1.0</version>
                <type>car</type>
            </module-id>
            <dependency>
                <groupId>console.dbpool</groupId>
                <artifactId>jdbc%2Fuserds</artifactId>
    	    <type>rar</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>openejb</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>system-database</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>tomcat6</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>axis</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>axis2</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>j2ee-corba-yoko</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>openjpa</artifactId>
                <type>car</type>
            </dependency>
    	<source-repository>file:/C:/myplugins</source-repository>
    	<source-repository>http://repo1.maven.org/maven2/</source-repository>
            <obsoletes>
                <groupId>default</groupId>
                <artifactId>StatelessSessionEJB</artifactId>
                <type>car</type>
            </obsoletes>
        </plugin-artifact>
        </plugin>
    <plugin>
            <name>Application Client</name>
            <category>Sample</category>
            <description>This plugin installs an App Client Sample</description>
            <url>http://www.apache.org</url>
            <author>Ashish Jain</author>
            <license osi-approved="true">The Apache Software License, Version 2.0</license>
    	<plugin-artifact>
            <module-id>
                <groupId>default</groupId>
                <artifactId>ApplicationClient</artifactId>
                <version>1.0</version>
                <type>car</type>
            </module-id>
            <dependency>
                <groupId>default</groupId>
                <artifactId>StatelessSessionEJB</artifactId>
                <version>1.0</version>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>tomcat6</artifactId>
                <version>2.1.1</version>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>axis</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>axis2</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>openejb</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>j2ee-corba-yoko</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>openjpa</artifactId>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>jasper</artifactId>
                <type>car</type>
            </dependency>
    	<source-repository>file:/C:/myplugins</source-repository>
    	<source-repository>http://repo1.maven.org/maven2/</source-repository>
            <obsoletes>
                <groupId>default</groupId>
                <artifactId>ApplicationClient</artifactId>
                <type>car</type>
            </obsoletes>
         </plugin-artifact>
    </plugin>
        <default-repository>http://geronimo.apache.org/plugins/geronimo-2.1/</default-repository>
    </geronimo-plugin-list>
    
  4. Once After this is done, place the plugins in the myplugins repository similar to geronimo the way that plugins are placed in the Geronimo repository. For example place jdbc%2Fuserds-1.0.rar in C:\myplugins\console\dbpool\jdbc%2Fuserds\1.0, ApplicationClient-1.0.car in C:\myplugins\default\ApplicationClient\1.0, and StatelessSessionEJB-1.0.car in C:\myplugins\default\StatelessSessionEJB\1.0
  5. This completes our initial set up setup to create a custom repository by using Geronimo Administrative administration console. Next Select , select the Plugin portlet and Select then click Add Repository as shown in the figure.





  6. Name the repository as myplugins and give the complete name as file:/C:/myplugins/*. Select click *Add Repository.





    This completes the addition of repository in geronimoGeronimo.

Importing the plugin

  1. Before we start importing our exported plugins, we should un-install uninstall the EJB jar, Application Client WAR, and database pool from the server. This can be down done as shown in the subsequent figures.











  2. Once After this is done, select myplugins repository from the drop-down list.





  3. Select Click Show plugins in selected repository.





  4. Now if we have observerd earlier , from the previous steps, we see that Application Client has StatelessSessionEJB as a dependency, which in turn has a dependency on the database pool. So Therefore, if we import our Application Client plugin. All , the other two plugins should be imported automatically. Check Select the Application Client plugin and Select click Install.





  5. Next The next screen will suggest displays the various artifacts associated with our Application Client plugin. Select Click Install.





  6. Once After this is done, the acknowledgement suggests that the Databasepool as well as and the Stateless session EJB has have been installed successfully installed.



    Once

    After this is done, you can re-test retest the functionality of the application functionality as suggested in Deploy and Run section.