Setting up WSADIE 5

backdamagedInternet and Web Development

Jul 30, 2012 (5 years and 1 month ago)

330 views

Setting up WSADIE 5.0 to develop and run applications using BRBeans




Assumptions:



You are using DB2 as your database.



You already have WSADIE 5.0 installed.


Start up WSADIE


Create a project containing BRBeans code



Open the J2EE perspective



From the main

menu select
File
-
>New
-
>EJB Project



Select
Create 2.0 EJB Project



Click
Next



Specify a Project Name, e.g. "BRBeansEJB"



Use default

should be selected for the EJB project



Specify an EAR Project Name, e.g. "BRBeansEAR"



Use default

should be selected for the
EAR project



Click
Finish



Right
-
click on the new BRBeansEJB project and select

Properties
from the menu



In the
Properties for BRBeansEJB

window select
Java Build Path



Click on the
Libraries

tab



Click the
Add Variable

button.



Select WAS_V5_XERCES



Click on
O
K
.



Click the
Add Variable

button



Select WAS_EE_V5



Click on
Extend...



In the
Variable Extension

window click on the ‘+’ sign next to the lib directory to
expand it



Select brbClient.jar



Hold down the Ctrl key and click on brbServer.jar, brbRuleMgmtApp.jar, a
nd
distexcep.jar to select them also



Click on
OK



Click on
OK.



Select
File
-
>Import



Select
EJB JAR file



Click
Next



Using the
Browse

button, locate the BRBeansDB2.jar file to import. This file can
be found in the WSADIE install directory at
<WSADIE_INSTALL_D
IR>
\
runtimes
\
ee_v5
\
BRBeans
\
BRBeansDB2.jar

or
it can be obtained from a WebSphere Application Server install.



Specify
Existing

and "BRBeansEJB" (the name of your project) for the
EJB
Project



Click
Finish



Many warning and informational messages will come up.

These can be ignored.
They do not cause any functional problems.


Deploy the EJB Jar file



We are now going to deploy the Jar file. In the J2EE perspective, J2EE Hierarchy
view, expand EJB Modules, right mouse click BRBeansEJB:BRBeansDB2 and select
Gene
rate
-
> Deploy and RMI Code...
.



From the
Generate
-
> Deploy and RMI Code

wizard, verify that all three beans are
checked and click
Finish
.



You should now have deployed code. The generated code can be seen in the J2EE
perspective, J2EE Navigator view, unde
r BRBeansEJB/ejbModule.


Create the database and database tables



If you have already created the database and database tables skip this step. There
are no specific instructions that pertain to WSADIE. That is, the tables you have
created to run within We
bsphere 5.0 will work fine.



In the J2EE perspective, J2EE Hierarchy view, under EJB Modules, select
BRBeansEJB:BRBeansDB2



Right click on BRBeansEJB:BRBeansDB2

and select
Generate
-
> Schema DDL
.
This generates the Table.ddl.



Open a DB2 Command Window by cl
icking on
Start
-
>Programs
-
>IBM DB2
-
>Command Window
.



Type the command:
db2 create database brb



In the DB2 command window, change to

<WSADIE_INSTALL_DIR>
\
Workspace
\
BRBeansEJB
\
ejbModule
\
META
-
INF

directory. Note that <WSADIE_INSTALL_DIR>
\
Workspace

is the dir
ectory
containing your WSADIE workspace. Since you are allowed to change this in
WSADIE, this may be a different directory on your machine.



Type the command:
db2 connect to brb



Type the command:
db2
-
tf Table.ddl



You should now have tables for the Rule an
d RuleFolder entity EJBs.



Set up a server



We will run within WSADIE's Unit Test environment using DB2



Create a datasource



From the main menu bar select
Window>Open Perspective
-
>Other...
, then
select Server in the
Select Perspective

window.



While in the s
erver perspective, click on
File
-
>New
-
>Server Project
.



Specify "BRBeansServer" for the
Project name
.



Use default

should be checked



Click
Finish



Click
File
-
>New
-
>Server and Server Configuration



Specify "BRBeansUnitTestServer" for the
server name



Specify "BR
BeansServer" for the server
Folder
.



For
Server type
expand
WebSphere Version 5.0

and select
EE Test
Environment



Click
Finish



In the Server Configuration view (bottom left), expand Servers, and double click
BRBeansUnitTestServer



In the editor, select the
Se
curity

tab at the bottom of the view



In the
JAAS Authentication Entries

section click the
Add...

Button.



In the
Add JAAS Authentication Entry

window type “BRBeansAlias” for
Alias
, and then type your DB2 user ID and password in the
User ID

and
Password

fiel
ds.



Click
OK



In the editor for the BRBeansUnitTestServer, select the
Data source

tab at
the bottom of the view.



Under
Server Settings
, in the
JDBC provider list
, select
Default DB2
JDBC Provider

and click the
Edit...

Button.



For
Class path

use the
Add Exte
rnal JARs...

button to navigate to the
location of db2java.zip and click the
Open

button to add the JAR to the list.



Select the entry that was originally in the
Class path

field
(${DB2_JDBC_DRIVER_PATH}/db2java.zip and click the
Remove

button.



Click
Finish



In the
JDBC provider list

select
Default DB2 JDBC Provider
.



Click the
Add...

button to the right of
Data source defined in the JDBC
provider selected above
.



In the
Create a Data Source

window select
DB2 JDBC Provider

and select
Version 5.0 data source
.



Cl
ick
Next



Specify BRBeansDataSource for the
Name
.



Specify
jdbc/BRBeansDataSource

for the
JNDI name



For
Container
-
managed authentication alias

select BRBeansAlias.



Click
Next



Select the
databaseName

property



For the value of this property specify the name of

your database, i.e. brb if
you used the above instructions to create the database.



Click
Finish



Save the file BRBeansUnitTestServer and close it.



Specify to use the datasource



In the J2EE perspective, J2EE Navigator view, expand BRBeansEJB to
"ejbModule/
META
-
INF/ejb
-
jar.xml".



Right click on "ejb
-
jar.xml" and select
Open with
-
>Deployment Descriptor
Editor



Select the
Overview

tab



Scroll down to the
WebSphere Bindings

section and find
JNDI
-

CMP Factory
Connection Binding



For the

JNDI name
, specify "eis/jdbc
/BRBeansDataSource_CMP". Note: this is
the JNDI name of the J2C connection factory that was automatically created
when you created the 5.0 data source.



Save and close the file



Tell the EJB application to run on the server we just created



In the Server Per
spective, Server Configuration View, under Servers, right click
on
BRBeansUnitTestServer

and select
Add
-
> BRBeansEAR
.


Start the Server



Start the server



In the Server Perspective, Servers view, select the
Servers
tab at the bottom.



Right click the Server
Instance
BRBeansUnitTestServer

and select
Start
.



This should switch you to the Console view automatically. If not, select the
Console

view tab at the bottom.



Wait for the message
Server server1 open for e
-
business
.



The test environment should now be start
ed. You should now be able to run
applications that use BRBeans. If you want to run the Rule Management
Application (RMA), proceed to the next step.


Run the Rule Management Application



Go to the Java perspective, the Package Explorer view.



Expand the B
RBeansEJB project and expand the jar file
WAS_EE_V5/lib/brbRuleMgmtApp.jar
.



Expand package
com.ibm.ws.brb.rm.ui.




Select the class
RuleManagement.class
.



In the main menu bar select
Run
-
> Run...



In the
Launch Configurations

window select
Java Application

and click on the
New

button at the bottom of the window. This should add a new Java application to
the list named RuleManagement.



On the
Main

tab verify that the
Project

is BRBeansEJB and the
Main class

is
com.ibm.ws.brb.rm.ui.RuleManagement.



Click on the

Arguments

tab.



Specify the following for
VM arguments
: "
-
DbrbPropertiesFile=<WSADIE
-
INSTALL
-
DIR>
\
runtimes
\
ee_v5
\
bin
\
brbeansDefaultProperties". Note: change <WSADIE
-
INSTALL
-
DIR> to the name of the directory where WSADIE is installed on your
machine. If t
here are spaces in the path name you should put double quotes around
the entire property as shown here.



Under
Working directory
, uncheck
Use default working directory

and select
Local directory
.



For
Local directory

specify <WSADIE
-
INSTALL
-
DIR>
\
runtimes
\
ee_
v5
\
bin



Click on the
JRE

tab.



Select the
WebSphere v5 EE JRE



Click on the
Classpath

tab.



Uncheck
Use default class path

at the bottom of the tab. This allows you to add
entries to the classpath.



Click the
Add External JARs...

Button.



Navigate to the <WSADI
E
-
INSTALL
-
DIR>
\
runtimes
\
ee_v5
\
lib directory and select the
file namingclient.jar.



Click
Open
. Namingclient.jar should be added to the classpath.



Click the
Advanced...

Button.



Select
Add External Folder

and click
OK
.



Navigate to the <WSADIE
-
INSTALL
-
DIR>
\
ru
ntimes
\
ee_v5
\
properties directory and
select it.



Click
OK
. The properties directory should be added to the classpath.



Click
Apply

to save the changes to the RuleManagement Java application.



Click the
Run

button. The Rule Management Application GUI should

come up. Note:
when you want to run RMA again you can simply go to the Java perspective, select
Run
-
> Run...

from the main menu, select RuleManagement, and click on
Run
. All
the changes made above are saved.