Chapter 3. Using the Examples

Table of Contents

3.1. Compiling the Examples
3.1.1. Requirements
3.1.2. Compile
3.2. Running Examples
3.2.1. Stateless Session Bean
3.2.1.1. Description
3.2.1.2. Running the Server
3.2.1.3. Deploying the Bean
3.2.1.4. Running the Client
3.2.2. Stateful Session Bean
3.2.2.1. Description
3.2.2.2. Running the Server
3.2.2.3. Deploying the Bean
3.2.2.4. Running the Client
3.2.3. Entity Bean
3.2.3.1. Description
3.2.3.2. Running the Server
3.2.3.3. Deploying the Bean
3.2.3.4. Running the Client

3.1. Compiling the Examples

3.1.1. Requirements

Before running the examples, be sure to follow the requirements for compiling and running these EasyBeans examples.

3.1.2. Compile

The ant tool is used to build the examples. To compile the examples, use the build.xml file that is located in the examples directory.

The command ant install_all_examples must be launched in the examples directory:

Buildfile: /home/benoitf/workspace/easybeans/examples/build.xml
install_all_examples:
init:
    [mkdir] Created dir: /home/benoitf/workspace/easybeans/output/dist/clients
    [mkdir] Created dir: /home/benoitf/workspace/easybeans/output/dist/ejbjars
    [mkdir] Created dir: /home/benoitf/workspace/easybeans/clients
compile:
    [javac] Compiling 5 source files to /home/benoitf/workspace/easybeans/output/classes
install.persistence:
install:
     [copy] Copying 4 files to /home/benoitf/workspace/easybeans/ejb3s/stateless.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-stateless.jar
init:
compile:
    [javac] Compiling 3 source files to /home/benoitf/workspace/easybeans/output/classes
install.persistence:
install:
     [copy] Copying 2 files to /home/benoitf/workspace/easybeans/ejb3s/stateful.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-stateful.jar
init:
compile:
    [javac] Compiling 4 source files to /home/benoitf/workspace/easybeans/output/classes
install.persistence:
    [mkdir] Created dir: /home/benoitf/workspace/easybeans/ejb3s/entitybean.jar/META-INF
     [copy] Copying 1 file to /home/benoitf/workspace/easybeans/ejb3s/entitybean.jar/META-INF
install:
     [copy] Copying 4 files to /home/benoitf/workspace/easybeans/ejb3s/entitybean.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-entitybean.jar
BUILD SUCCESSFUL
Total time: 4 seconds
The examples are copied under the ejb3s/ folder of the project and are available for the deployment.

[Note]Note

If the EasyBeans server is running, it will detect these new applications and deploy them automatically.