Getting Started With Jonas; Running The First Ejb Application - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

This tutorial guides you through running a first example EJB. Guidance is also provided for running
a more complex example in which an EJB has access to a database.
You can find additional information about JOnAS configuration in Chapter 3 JOnAS Configuration.

2.1. Running the First EJB Application

2.1.1. JOnAS Examples
There are several examples in the JOnAS distribution under
should run the example located in the $JONAS_ROOT/examples/src/sb/ directory first.
In this example, a Java client accesses a stateful Session Bean and calls the
several times inside the scope of transactions.
2.1.2. Building the sb Example
The easiest way to compile this example is to go to the
and use the
compile.sh
2.1.3. Running the sb Example
This a distributed example in which two processes are involved:
The JOnAS server, in which beans will be loaded
The Java client that creates instances of beans and calls business methods on it.
To run this example:
1. Run the JOnAS server:
service jonas start
The following message is displayed on the standard output:
The JOnAS Server 'jonas' version-number is ready
2. Make beans available to clients by loading the
jonas admin -a sb.jar
The following message is displayed on the standard output:
message-header: Op available
3. Run the Java client in another terminal command-line window:
jclient sb.ClientOp
4. If the following output displays, the first EJB application with JOnAS has run successfully:
Create a bean
Start a first transaction
First request on the new bean
Second request on the bean
Commit the transaction
Start a second transaction

Getting Started with JOnAS

shell script.
$JONAS_ROOT/examples/src
directory $JONAS_ROOT/examples/src/sb/
sb
containing the sb example:
jar
Chapter 2.
. You
method of the bean
buy

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the APPLICATION SERVER - JONAS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Application server

Table of Contents