Excerpt |
---|
This topic will take you through plugin export and import using Apache Geronimo. |
We are using Apache Geronimo V2.1.1 for this tutorial.
We have used an existing tutorial from tutorial section. Refer Stateless Session Bean tutorial for application development and deployment. Once done refer the illustration in this tutorial to export and import JEE artifacts from Apache Geronimo administration console.
Info |
---|
|
Application client referred in this tutorial is actually a Web Application Client. |
Exporting the application as a plugin
- Launch the Administrative console and Select Plugin portlet under Applications.
![](/confluence/download/attachments/93268/export1.png?version=1&modificationDate=1212974766000&api=v2)
- Under Create Geronimo Plugin select jdbc/userds database pool from the drop down menu as shown in the figure.
![](/confluence/download/attachments/93268/export2.png?version=1&modificationDate=1274053202000&api=v2)
- Once done select Export Plugin.
![](/confluence/download/attachments/93268/export3.png?version=1&modificationDate=1274053374000&api=v2)
- On the next page keep all the values default and Select Saving Plugin Data.
![](/confluence/download/attachments/93268/export4.png?version=1&modificationDate=1212974766000&api=v2)
- On the next screen select Export Plugin.
![](/confluence/download/attachments/93268/export5.png?version=1&modificationDate=1274053225000&api=v2)
Info |
---|
Starting from Geronimo V2.1.3, you can also choose to convert your applications within Geronimo with one-click instead of manual import and export. To do so, just click Done to convert the application into plugin directly. |
- A window will pop-up suggesting to save the plugin. Select Ok.
![](/confluence/download/attachments/93268/export6.png?version=1&modificationDate=1274053226000&api=v2)
- Similarly export ApplicationClient and StatelessSessionEJB as a plugin.
![](/confluence/download/attachments/93268/export7.png?version=1&modificationDate=1212974788000&api=v2)
![](/confluence/download/attachments/93268/export8.png?version=1&modificationDate=1212974788000&api=v2)
Create a custom repository from Geronimo Administrative Console
- Create a folder say myplugins in your hard drive.
- Copy the exported plugins to this directory.
- Next create a geronimo-plugins.xml which will enlist all the plugins in our repository.
Code Block |
---|
title | geronimo-plugins.xml |
---|
borderStyle | solid |
---|
|
<?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>
|
- Once this is done place the plugins in the myplugins repository similar to 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
- This completes our initial set up to create a custom repository using Geronimo Administrative console. Next Select the Plugin portlet and Select Add Repository as shown in the figure.
![](/confluence/download/attachments/93268/import1.png?version=1&modificationDate=1212979875000&api=v2)
- Name the repository as myplugins and give the complete name as file:/C:/myplugins/*. Select *Add Repository.
![](/confluence/download/attachments/93268/import2.png?version=1&modificationDate=1212979875000&api=v2)
This completes the addition of repository in geronimo.
Importing the plugin
- Before we start importing our exported plugins we should un-install the EJB jar, Application Client WAR and database pool from server. This can be down as shown in the subsequent figures.
![](/confluence/download/attachments/93268/import5.png?version=1&modificationDate=1212979875000&api=v2)
![](/confluence/download/attachments/93268/import6.png?version=1&modificationDate=1212979920000&api=v2)
![](/confluence/download/attachments/93268/import7.png?version=1&modificationDate=1212979920000&api=v2)
- Once done select myplugins repository from the drop down list.
![](/confluence/download/attachments/93268/import3.png?version=1&modificationDate=1212979875000&api=v2)
- Select Show plugins in selected repository.
![](/confluence/download/attachments/93268/import4.png?version=1&modificationDate=1212979875000&api=v2)
- Now if we have observerd earlier that Application Client has StatelessSessionEJB as a dependency which in turn has a dependency on the database pool. So if we import our Application Client plugin. All the plugins should be imported automatically. Check the Application Client plugin and Select Install.
![](/confluence/download/attachments/93268/import9.png?version=1&modificationDate=1212979920000&api=v2)
- Next screen will suggest the various artifacts associated with our Application Client plugin. Select Install.
![](/confluence/download/attachments/93268/import10.png?version=1&modificationDate=1212979920000&api=v2)
- Once done the acknowledgement suggests that Databasepool as well as Stateless session EJB has been successfully installed.
![](/confluence/download/attachments/93268/import12.png?version=1&modificationDate=1212979937000&api=v2)
Once this is done you can re-test the application functionality as suggested in Deploy and Run section.