using open ejb l.
Skip this Video
Loading SlideShow in 5 Seconds..
Using Open EJB PowerPoint Presentation
Download Presentation
Using Open EJB

Loading in 2 Seconds...

play fullscreen
1 / 21

Using Open EJB - PowerPoint PPT Presentation

  • Uploaded on

Using Open EJB. --Use Tomcat, openejb, SSL and JSP to Implement an Inventory Query System Hongfang Shen Praveen Mynam Gaurav Kochhar Bhandari, Arathi. Open EJB.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Using Open EJB' - albert

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
using open ejb

Using Open EJB

--Use Tomcat, openejb, SSL and JSP

to Implement an Inventory Query System

Hongfang Shen

Praveen Mynam

Gaurav Kochhar

Bhandari, Arathi

open ejb
Open EJB
  • OpenEJB is an open source EJB container that you can download for free. All you need is OpenEJB to run Enterprise JavaBeans. The OpenEJB web site has a detailed “Hello World” tutorial that works with a local or remote server.
  • The OpenEJB web site also provides detailed instructions on how to install OpenEJB on a Tomcat server. Tomcat is a servlet container and does not host EJB components. OpenEJB allows you to add EJB components to Tomcat servlets and Java Server Pages.
open ejb3
Open EJB
  • The OpenEJB site provides a “Hello World” servlet example called and a “Hello World” Java Server Page example called openejb.jsp. Click on Tomcat under Servers on the OpenEJB web site and follow links.
  • Once you are comfortable with using EJBs with Tomcat, I recommend learning how the javax.ejb package interfaces and exception classes work through examples on the internet. The javax.ejb package can be found in the J2EE 1.4 API.
  • Here is the link to OpenEJB.

First Tier


AFS11 (Tomcat+openejb+SSL)

Second Tier




Third Tier


System architecture

introduction cont
Introduction (cont.)
  • Highlights--Security
  • Digital Certificate
introduction cont6
Introduction (cont.)
  • Highlights--Security
  • Identity authentication
introduction cont7
Introduction (cont.)

Highlights—Search Engine

system design
System Design
  • Client/Server
    • Server side uses Tomcat +SSL+OpenEJB. The business logic is implemented in JSP and Enterprise JavaBeans.
    • Client side is a standard web browser.
  •  Two Enterprise JavaBeans
    • search engine Enterprise JavaBean--takes product name as parameter and search the inventory database and return the search result.
    • authentication bean--takes the users’ ID and password as parameters, and compare the message digest of the password with the digest stored in the database.
  •  Integration
    • The two Enterprise JavaBeans integrated with Java Server Pages (JSP) to implement the business logic.
steps to config tomcat openejb
Steps to config Tomcat/OpenEJB
  • Install Tomcat (see related class presentation)
  • Install OpenEJB
    • Step1: download

    • Step2: unzip to $HOME

a new directory openejb-0.9.2 will be created

    • Step3: add environment variable to .login script file.

setenv OPENEJB_HOME $HOME/ openejb-0.9.2

    • Step4: make files under the bin directory executable.

chmod a+x $OPENEJB_HOME/bin/*

chmod a+x $OPENEJB_HOME/

steps to config tomcat openejb cont
Steps to config Tomcat/OpenEJB(cont.)
  • Config Tomcat to Support OpenEJB
    • copy openejb class loader to $TOMCAT_HOME/webapps folder

cp $OPENEJB_HOME/dist/openejb_loader-0.9.2.war $TOMCAT_HOME/webapps

    • modify the config file of openejb class loader to specify openejb home folder.

(1) Start the Tomcat server using the following command:

$TOMCAT_HOME/bin/ run

(2) a new folder openejb-loader-0.9.2 will be created under


(3)modify the config file—web.xml under the new folder and change the value of parameter openejb.home to the openejb home folder (the value of $OPENEJB_HOME variable).

steps to config tomcat openejb cont11
Steps to config Tomcat/OpenEJB(cont.)
  • Config Tomcat to Support SSL

Step 1: set JSSE_HOME environment variable.

setenv JSSE_HOME $JAVA_HOME/jre 

Step 2: create a certificate

$JAVA_HOME/bin/keytool –genkey –alias tomcat –keyalg RSA

System will ask you several questions. After answering all these questions, a .keystore file

will be generated.

Step 3: modify TOMCAT config file to support SSL.

Modify the server.xml file under TOMCAT_HOME/conf folder, uncomment the SSL

section. Then change the port number to the number you desire. Finally, add the

following content into the server.xml SSL section.

<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"

clientAuth="false" protocol="TLS"

keystoreFile="/afs/" />

Note: the keystoreFile is the location where your .keystore stored.

steps to config tomcat openejb cont12
Steps to config Tomcat/OpenEJB(cont.)
  • start and stop Tomcat and OpenEJB.
  • $TOMCAT_HOME/bin/ run
  • $TOMCAT_HOME/bin/ stop
implement business logic
Implement Business Logic
  • Implement Enterprise JavaBeans
  • write password authentication Enterprise JavaBean
    • (1) 
    • (2)
    • (3)
  • write inventory search Enterprise JavaBean
    • (1)
    • (2)
    • (3)
implement business logic cont
Implement Business Logic (cont.)
  • Register and Deploy Enterprise JavaBeans
    • First, create a bean descriptor file to describe your beans;
    • Second,package your bean into a .jar file.
    • Next, deploy the EJB beans into Openejb.
    • Finally, register the EJB beans in Tomcat config file so that Servlet or JSP in Tomcat can use it.
implement business logic cont15
Implement Business Logic (cont.)
  • Password EJB bean descriptor file under META-INF folder -- ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>










implement business logic cont16
Implement Business Logic (cont.)













implement business logic cont17
Implement Business Logic (cont.)
  • package the EJB bean:

Jar cvf myPasswordEJB.jar cis604 META-INF

  • deploy the bean:

$OPENEJB_HOME/ deploy –a –f –c $HOME/ myPasswordEJB.jar

implement business logic cont18
Implement Business Logic (cont.)
  • Register the EJB beans in Tomcat server, adding to examples context section of $TOMCAT_HOME/conf/server.xml.

<Ejb name="ejb/password"




<ResourceParams name="ejb/password">





implement business logic cont19
Implement Business Logic (cont.)









implement business logic cont20
Implement Business Logic (cont.)














implement business logic cont21
Implement Business Logic (cont.)
  • write Java Server Pages and interface html files

(1)   login.htm

(2)   create_new.jsp

(3)   search_byname.jsp

(4)   searchejb.jsp