Step by Step How to Create a One-Click EJB and deploy it to WebSphere

Creating a Session Bean


public String hello(){ System.out.println("hello()"); return "Hello World"; }

Note: Make sure that return types of hello() method in the "HelloBean" and in "Hello" are identical (String).

The bean is now ready for deployment to WebSphere 3.5.

Deploying the Bean


Parameter name

Setting

Comment

Admin Node Name

Name of the Node to deploy

Name of the computer

Application Server Name

Your Application Server

"Default Server" by default

EJB Container name

Your Container name

"Default Container" by default

Target WebSphere server directory

WebSphere home directory

e.g. c:\WebSphere\AppServer

Launch server in debug mode

OFF

 

If you have checked Hot Deploy check box, the last message in the Message Pane should be:

//WAS35: Finished with 0 Errors, 0 Warnings.

It means the deployment process successfully completed. Let's now proceed with creating a client.

Creating a client

By now you have a project with HelloWorld Session bean, which is deployed to WebSphere Server 3.5.

import javax.naming.*;
import java.util.Properties;
import hello.*;

The client is now ready for compiling and running.

Compiling and running the client


%WAS_HOME%\jdk\jre\lib\ext\rmiorb.jar
%WAS_HOME%\jdk\jre\lib\ext\iioprt.jar
Deployed jar file (e.g. %WAS_HOME%\deployableEJBs\DeployabletogetherEJB.jar)
Home directory of WebSphere Server %WAS_HOME%

This is done in the following way