Configuring this project takes approximately 5 minutes.
The following steps show you how to import, run, and explore the
sample:
- Before you can run the sample, you must first import it into your
workspace.
- Import the sample.
- In the Import Project dialog box, accept the defaults and click Finish.
- To run the program:
- Expand the SimpleCalculatorEJB > Deployment Descriptor: SimpleCalculatorEJB
> Session Beans directories. Right-click the SimpleCalculator bean,
and select . To select a server:
- Click Choose an existing server and select a server.
- If there is no existing server, click Manually define a new server and
select a server. Click Next and accept the defaults.
- Click Next, and check to make sure that SimpleCalculatorEJBEAR is
listed under Configured projects. Click Finish.
- Once the server is running, and the Universal Test Client window
has opened, click on the JNDI Explorer link on the left. If
a Universal Test Client window does not open, in the Servers view, right-click
the server and select Run universal test client.
- Expand the ejb > ejbs directories, and click on SimpleCalculatorHome.
- SimpleCalculatorHome will appear under EJB Beans on
the left of the screen. Click on the plus sign next to SimpleCalculatorHome
to expand.
- A Create method will be listed under SimpleCalculatorHome.
Click on it to bring it up in the Universal Test Client window on the right
of the screen.
- Click Invoke, and then click Work with Object. SimpleCalculator will appear under SimpleCalculatorHome. Expanding
that menu will display the different methods that you can work with.
- To explore the sample:
- Expand the SimpleCalculatorEJB project.
- Expand the ejbModule directory, and the ejbs package.
- Double-click on SimpleCalculatorBean.java to view the code.