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.2.3.5. Properties for the persistence
3.2.4. Security example
3.2.4.1. Description
3.2.4.2. Running the Server
3.2.4.3. Deploying the Bean
3.2.4.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:

$ ant install_all_examples
Buildfile: build.xml

install_all_examples:

init:

compile:
    [javac] Compiling 7 source files to /home/benoitf/workspace/easybeans/output/example-classes

install.persistence:

install.war:
    [mkdir] Created dir: /home/benoitf/workspace/easybeans/webapps/stateless.war/WEB-INF/classes
     [copy] Copying 6 files to /home/benoitf/workspace/easybeans/webapps/stateless.war/WEB-INF/classes
     [copy] Copying 1 file to /home/benoitf/workspace/easybeans/webapps/stateless.war/WEB-INF

install:
     [copy] Copying 5 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/example-classes

install.persistence:

install.war:

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/example-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.war:

install:
     [copy] Copying 4 files to /home/benoitf/workspace/easybeans/ejb3s/entitybean.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-entitybean.jar

init:

compile:
    [javac] Compiling 3 source files to /home/benoitf/workspace/easybeans/output/example-classes

install.persistence:

install.war:

install:
     [copy] Copying 2 files to /home/benoitf/workspace/easybeans/ejb3s/mdb.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-mdb.jar

init:

compile:
    [javac] Compiling 5 source files to /home/benoitf/workspace/easybeans/output/example-classes

install.persistence:

install.war:

install:
     [copy] Copying 4 files to /home/benoitf/workspace/easybeans/ejb3s/security.jar
      [jar] Building jar: /home/benoitf/workspace/easybeans/clients/client-security.jar

BUILD SUCCESSFUL
Total time: 8 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.