Chapter 4. Using the examples

Table of Contents

4.1. Compiling the examples
4.1.1. Requirements
4.1.2. Compile
4.2. Running examples
4.2.1. Stateless session bean
4.2.1.1. Description
4.2.1.2. Run the server
4.2.1.3. Deploying the bean
4.2.1.4. Run the client
4.2.2. Stateful session bean
4.2.2.1. Description
4.2.2.2. Run the server
4.2.2.3. Deploying the bean
4.2.2.4. Run the client
4.2.3. Entity bean
4.2.3.1. Description
4.2.3.2. Run the server
4.2.3.3. Deploying the bean
4.2.3.4. Run the client

4.1. Compiling the examples

4.1.1. Requirements

Before trying to run the examples, the requirements in order to compile and run EasyBeans have to be followed.

4.1.2. Compile

The ant tool is used to build the examples. This time, the build.xml file that is used is located in the examples directory.

The command ant install_all_examples needs to 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 EasyBeans server is running, it will detect these new applications and deploy them automatically.