application topic will take you through |
the basics of plugin transform,export and import using Apache Geronimo administration console. |
We have used an existing tutorial from tutorial section. Refer Stateless Session Bean. This application will demonstrate how annotations like @Stateless, @Resource, @PostConstruct, @PreDestroy are used in an EJB3 application.The application walks through a authentication page, where the user has to authenticate to move to the resource page of Apache Geronimo. In case of a new user, the user has to go through the registration process. Later the user will be directed to login page again once the registration is done. In the login page the bean class will check for the username and password entered by the user against a database.
Basically a Stateless Session EJB is used whenever there is a single step process and maintaining a session is obsolete. In this sample the user registration form is a one step process and hence we have used stateless session bean for its implementation. The login page is a misnomer and should not be considered as an implementation for stateless session ejb. This is because once logged in you need to maintain the session and stateless session beans are not meant to maintain the session.
To run this tutorial, as a minimum you will be required to have installed the following prerequisite software.
- Sun JDK 5.0+ (J2SE 1.5)
- Eclipse 3.3.1.1 (Eclipse Classic package of Europa distribution), which is platform specific
- Web Tools Platform (WTP) 2.0.1
- Data Tools Platform (DTP) 1.5.1
- Eclipse Modeling Framework (EMF) 2.3.1
- Graphical Editing Framework (GEF) 3.3.1
Details on installing eclipse are provided in the Development environment section.
This tutorial is organized in the following sections:
Creating a Stateless Session EJB project
...
Code Block |
---|
title | RegisterBeanRemote.java |
---|
borderStyle | solid |
---|
|
package statelessejb;
import javax.ejb.Remote;
@Remote
public interface RegisterBeanRemote
{
public void register(String FirstName, String LastName, String Sex, String UserName, String Password);
public boolean verify(String username, String password);
}
|
...
Code Block |
---|
title | RegisterBean.java |
---|
borderStyle | solid |
---|
|
package statelessejb;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.sql.DataSource;
@Stateless
public class RegisterBean implements RegisterBeanRemote{
@Resource(name="jdbc/userds")
private DataSource dbsource;
private Connection dbconnect;
@PostConstruct
public void initialize()
{
try{
dbconnect= dbsource.getConnection();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public void register(String FirstName, String LastName, String Sex, String UserName, String Password)
{
try
{
String insert="INSERT INTO USERINFO (" + "FIRSTNAME," + "LASTNAME," + "SEX," + "USERNAME," + "PASSWORD)" + " VALUES(?,?,?,?,?)";
PreparedStatement ps=dbconnect.prepareStatement(insert);
ps.setString(1,FirstName);
ps.setString(2,LastName);
ps.setString(3,Sex);
ps.setString(4,UserName);
ps.setString(5,Password);
int rs =ps.executeUpdate();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public boolean verify(String username, String password)
{
boolean ret=false;
String select="SELECT * FROM USERINFO";
try{
PreparedStatement ps=dbconnect.prepareStatement(select);
ResultSet rs= ps.executeQuery();
while(rs.next())
{
String str=(rs.getString("USERNAME")).trim();
String str1=(rs.getString("PASSWORD")).trim();
if (str.compareTo(username)==0)
{
if(str1.compareTo(password)==0)
{
ret=true;
break;
}
else
ret=false;
}
else
ret=false;
}
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.println(ret);
return ret;
}
@PreDestroy
public void destroy(){
try
{
dbconnect.close();
dbconnect=null;
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
|
tutorial for application development and deployment. Once done refer the illustration in this tutorial to export and import Java EE artifacts from Apache Geronimo administration console.
Info |
---|
|
Application client referred in this tutorial is actually a Web Application Client. Starting from Geronimo V2.2, only car packages will be listed for export. |
Converting the application into a plugin via console
In this section, we will convert an existing applications into a plugin directly via console.
- Launch the Administrative console and Select Plugin portlet under Applications.
Image Added
- Under Create Geronimo Plugin select jdbc/userds database pool from the drop-down menu.
Image Added
- Once done select Export Plugin.
Image Added
- On the next page keep all the values default and Select Saving Plugin Data.
Image Added
- On the next screen select Export Plugin to convert the resource pool archive into a plugin directly.
Image Added
- Similarly convert ApplicationClient and StatelessSessionEJB into plugins.
Exporting and importing plugins via console
We are using Apache Geronimo V2.2 for this tutorial.
Exporting the application as a plugin
- Launch the Administration console and Select Plugin portlet under Applications.
Image Added
- Under Create Geronimo Plugin select jdbc/userds database pool from the drop down menu as shown in the figure.
Image Added
- Once done select Export Plugin.
Image Added
- On the next page keep all the values default and Select Saving Plugin Data.
Image Added
- On the next screen select Export Plugin.
Image Added
- A window will pop-up suggesting to save the plugin. Select OK.
Image Added
- Similarly export ApplicationClient and StatelessSessionEJB as a plugin.
Image Added
Image Added
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_userds</artifactId>
<version>1.0</version>
<type>car</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_userds</artifactId>
<type>car</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_userds</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>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> |
...
Warning |
---|
|
Due to some limitations in Geronimo Eclipse Plugin the generated deployment plan(openejb-jar.xml) does not have the correct namespace. Replace the existing namespace as shown in the figure with the following <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> |
...
Creating a database using Administrative Console
...
Code Block |
---|
title | CreateTable.sql |
---|
borderStyle | solid |
---|
|
CREATE TABLE USERINFO
(
FIRSTNAME char(20),
LASTNAME char(20),
SEX char(7),
USERNAME char(20),
PASSWORD char(20)
)
|
...
Creating a datasource using Administrative Console
...
Creating application client
- Create a new dynamic Web Project with the name Application Client.
- Right click on WebContent and create the following jsp's
Code Block |
---|
title | login.jsp |
---|
borderStyle | solid |
---|
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome to Apache Geronimo</title>
</head>
<body bgcolor="white">
<form method="post" action="passCredentials.jsp">
<h2 align="center"><font color="blue">Welcome to Apache Geronimo</font></h2>
<h2 align="center"><font color="blue">Enter your credentials</font></h2>
Enter your Username
<input type="text" name="username" size=20><br>
Enter your Password
<input type="password" name="password" size=20><br>
<input type="submit" value="Login">
<a href="http://localhost:8080/ApplicationClient/register.jsp">NewUser</a>
</form>
</body>
</html>
|
This form is the login page for our application. Once the user enters his/her credentials, these are passed to another jsp passCredentials.jsp(checkout the action in the form tag) to verify the authenticity of user credentials. In case the user is new he has to go through the registration process. This statement <a href="http://localhost:8080/ApplicationClient/register.jsp">NewUser</a> is used to route the user to registration page. Code Block |
---|
title | passCredentials.jsp |
---|
borderStyle | solid |
---|
|
<%@ page import="java.util.Properties,javax.naming.Context,javax.naming.InitialContext,statelessejb.RegisterBeanRemote" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="white">
<%!boolean i; %>
<%
Properties prop=new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
prop.put("java.naming.provider.url", "ejbd://localhost:4201");
Context context = new InitialContext(prop);
RegisterBeanRemote myejb=(RegisterBeanRemote)context.lookup("RegisterBeanRemote");
String s= request.getParameter("username");
String s1= request.getParameter("password");
i=myejb.verify(s,s1);
%>
<%
if (i==true){
%>
<jsp:forward page="/resources.jsp"></jsp:forward>
<%
} else {
%>
<jsp:forward page="/login.jsp"></jsp:forward>
<%
}
%>
</body>
</html>
|
<%!boolean i; %> is a declaration for a global variable. The other part is a scriptlet which does a JNDI lookup to the remote interface. Later the user credentials are passed to verify function. In case the credentials are correct user is routed to the resources page else he is redirected to login page to re-login. Tip |
---|
title | Why is the lookup name RegisterBeanRemote?? |
---|
|
This will be explained in the deploy an run section |
Code Block |
---|
title | resources.jsp |
---|
borderStyle | solid |
---|
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome to Apache Geronimo</title>
</head>
<body bgcolor="white">
<h3><font color="blue">Welcome to Apache Geronimo Resource Center</font></h3>
Apache Geronimo Home Page
<a href="http://geronimo.apache.org">Apache Geronimo Home page</a><br>
Join our mailing list
<a href="http://geronimo.apache.org/mailing-lists.html">Apache Geronimo Mailing List</a><br>
Come and Contribute to Apache Geronimo V2.1 Documentation
<a href="http://cwiki.apache.org/GMOxDOC22/">Apache Geronimo V2.1 Documentation</a>
</body>
</html>
|
This is the final page of the application which displays the various resources. Code Block |
---|
title | register.jsp |
---|
borderStyle | solid |
---|
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome to Apache Geronimo</title>
</head>
<body bgcolor="white">
<script type="text/javascript">
function valForm()
{
if (this.document.form1.username.value=="" || this.document.form1.username.value=="")
{
alert("You cannot leave the field blank");
this.document.form1.firstname.focus();
return false;
}
else
{
return true;
}
}
</script>
<h2 align="center"><font color="blue">Welcome to Apache Geronimo User Registration</font></h2>
<form method="post" name="form1" action="passVariables.jsp" onSubmit=" return valForm();">
FirstName
<INPUT type="text" name="firstname" SIZE=20><br>
LastName
<INPUT type="text" name="lastname" SIZE=20 ><br>
Sex<br>
<input type="radio" name="sex" value="male"> Male
<br>
<input type="radio" name="sex" value="female"> Female
<br>
Select a UserName<br>
<input type="text" name="username" size=20><br>
Select a Password<br>
<input type="password" name="password" size=20><br>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
|
This page is the registration page. Once th user fills up the form and press Submit a valform() function is called which validates the field username and password. In case any of them is empty an alert is send which suggests empty fields in the form. If all is fine passVariables.jsp is called. Code Block |
---|
title | passVariables.jsp |
---|
borderStyle | solid |
---|
|
<%@ page import="java.util.Properties,javax.naming.Context,javax.naming.InitialContext,statelessejb.RegisterBeanRemote" %>
<html>
<head>
<meta http-equiv="Refresh" content="5;URL=http://localhost:8080/ApplicationClient/login.jsp">
<title>Welcome to Apache Geronimo</title>
</head>
<%
Properties prop=new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
prop.put("java.naming.provider.url", "ejbd://localhost:4201");
Context context = new InitialContext(prop);
RegisterBeanRemote myejb=(RegisterBeanRemote)context.lookup("RegisterBeanRemote");
String s= request.getParameter("firstname");
String s1= request.getParameter("lastname");
String s2= request.getParameter("sex");
String s3= request.getParameter("username");
String s4= request.getParameter("password");
myejb.register(s,s1,s2,s3,s4);
%>
<h3 align="center"><font color="blue">Thank you for registering with Apache Geronimo</font></h3>
<h3 align="center"><font color="blue">Redirecting to Login Page</font></h3>
</html>
|
In this page the fields are retrieved from register.jsp and the register function in the bean class is called to populate the database.
The code <meta http-equiv="Refresh" content="5;URL=http://localhost:8080/ApplicationClient/login.jsp
Image Removed"> suggests to wait for 5 seconds and then move to login.jsp Code Block |
---|
title | index.jsp |
---|
borderStyle | solid |
---|
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<jsp:forward page="/login.jsp" />
</body>
</html>
|
Few more configurations
- In the EJB Project. Under META-INF, Edit openejb-jar.xml and add the following
Code Block |
---|
title | datasource dependency |
---|
borderStyle | solid |
---|
|
<sys:dependencies>
<sys:dependency><groupId>default</groupId>
<artifactId>StatelessSessionEJB</artifactId>
<sys:groupId>console.dbpool</sys:groupId> <type>car</type>
</obsoletes>
</plugin-artifact>
<sys:artifactId>jdbc%2Fuserds</sys:artifactId></plugin>
<plugin>
<name>Application Client</name>
</sys:dependency> <category>Sample</category>
</sys:dependencies>
|
Finally the openejb-jar.xml will look like this Code Block |
---|
title | openejb-jar.xml |
---|
borderStyle | solid |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId>
<sys:groupId>default</sys:groupId>
<sys:artifactId>StatelessSessionEJB</sys:<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>
<sys:version>1.0</sys:version>
<version>2.1.1</version>
<sys:type>car</sys:type>
<<type>car</sys:moduleId>type>
<sys:dependencies>
</dependency>
<sys:dependency><dependency>
<groupId>org.apache.geronimo.configs</groupId>
<sys:groupId>console.dbpool</sys:groupId>
<artifactId>axis</artifactId>
<sys:artifactId>jdbc%2Fuserds</sys:artifactId>
<type>car</type>
</sys:dependency>
</sys:dependencies>
</sys:environment>
<enterprise-beans/>
</openejb-jar>
|
Info |
---|
title | Where did the above dependencies come from?? |
---|
|
To make the datasource visible to EJB we need to add a dependency to the EJB deployment plan that is openejb-jar.xml. The above element can be obtained automatically from Geronimo Database Pool wizard. Select usage against the database pool jdbc/userds |
In the WEB Project. Under WEB-INF, Edit geronimo-web.xml and add the following Code Block |
---|
title | EJB dependency |
---|
borderStyle | solid |
---|
|
<sys:dependencies>
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>axis2</artifactId>
<type>car</type>
<sys:dependency></dependency>
<dependency>
<sys:groupId>default</sys:<groupId>org.apache.geronimo.configs</groupId>
<sys:artifactId>StatelessSessionEJB</sys: <artifactId>openejb</artifactId>
<sys:version>1.0</sys:version>
<sys:type>car</sys:<type>car</type>
</sys:dependency>
</sys:dependencies>
|
Finally the geronimo-web.xml will look like this Code Block |
---|
title | geronimo-web.xml |
---|
borderStyle | solid |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId>
<sys:groupId>default</sys:groupId>
<sys:artifactId>ApplicationClient</sys:<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>
<sys:version>1.0</sys:version>
<sys:type>car<<type>car</sys:type>
</sys:moduleId>
<sys:dependencies>/dependency>
<source-repository>file:/C:/myplugins</source-repository>
<source-repository>http://repo1.maven.org/maven2/</source-repository>
<sys:dependency> <obsoletes>
<sys:groupId>default<<groupId>default</sys:groupId>
<sys:artifactId>StatelessSessionEJB</sys: <artifactId>ApplicationClient</artifactId>
<sys:version>1.0</sys:version>
<sys:type>car</sys:<type>car</type>
</sys:dependency>obsoletes>
</plugin-artifact>
</sys:dependencies>plugin>
</sys:environment>
<context-root>/ApplicationClient</context-root>
</web-app>
|
- Right click the ApplicationClient Project and select properties. Select Java Build Path->Projects. Click add and add Stateless Session EJB. This is required for the compilation of the Client code.
Deploy and Run
Warning |
---|
|
Due to limitation with Geronimo Eclipse Plugin, you will have to export the Stateless Session EJB project and Web Application project as a jar and war respectively. |
<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_userds-1.0.car in C:\myplugins\console\dbpool\jdbc_userds\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.
Image Added
- Name the repository as myplugins and give the complete name as file:/C:/myplugins/*. Select *Add Repository.
Image Added
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.
Image Added
Image Added
Image Added
- Once done select myplugins repository from the drop down list.
Image Added
- Select Show plugins in selected repository.
Image Added
- 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.
Image Added
- Next screen will suggest the various artifacts associated with our Application Client plugin. Select Install.
Image Added
- Once done the acknowledgement suggests that Databasepool as well as Stateless session EJB has been successfully installed.
Image Added
Once this is done you can re-test the application functionality as suggested in Deploy and Run section. - Export the projects to your local disk as StatelessSessionEJB.jar and ApplicationClient.war.
- Start the server and launch the Administrative console using http://localhost:8080/console/. Enter default username and password.
In the welcome page, under Applications. Select Deploy New.
Image Removed
- Browse and Select StatelessSessionEJB.jar. Once done Select Install. This will deploy the EJB application on to server.
- Browse and Select ApplicationClient.war. Once done select Install. This will deploy the Web application on to server.
- Under Applications, Select Web App WARs and Run ApplicationClient project as show in the figure.
Image Removed
Once done a welcome page will be launched.
Image Removed
If you are New User. Select New User as shown in the figure
Image Removed
This will display a new registration form. If you leave the mandatory username or password filed empty. You will get the following error message.
Image Removed
Fill the fields as shown in the figure and Select Submit.
Image Removed
Once done a page will be displayed from where you will be automatically redirected to login page to relogin.
Image Removed
Enter the username and password as chosen by you during registration and select Login.
Image Removed
The next page is the Apache Geronimo Resource Center.
Image Removed
In case you give wrong username and password combination you will be redirected to login page.
Image Removed