Installing the EJB examples

This article describes how to install the EJB examples shipped with the Orion distribution.

1 Running the Product Client

    1. Make sure that a valid DataSource is available.

      For information on how to configure a data-source please see this guide.

    2. If the ejbsamples application is not already deployed this is done by adding the lines given in listing 1 below to the server.xml configuration file found in the config/ directory:

      For more information on how to deploy applications, see this guide.

    3. For remote RMI access to the EJBs you also need to activate the admin user account if it is not already activated. To do this, edit the principals.xml file and remove the attribute deactivated="true" from the user tag for the admin user.

    4. Make sure Orion is up and running.

    5. Change directory to the demo/ejb/product directory.

    6. Start the client by typing the command given in listing 2 below.


    <application name="ejbsamples" path="../demo/ejb" />

    Listing 1: deploying an application


    java -classpath ../../../orion.jar;../../../ejb.jar;../../jndi.jar ProductClient

    Listing 2: Running the Product client

    (use ':' insted of ';' as path-separator on UNIX)

2 Running the Cart client

    1. Make sure that a valid DataSource is available.

      For information on how to configure a data-source please see this guide.

    2. If the ejbsamples application is not already deployed this is done by adding the lines given in listing 3 below to the server.xml configuration file found in the config/ directory.

      For more information on how to deploy applications, see this guide.

    3. For remote RMI access to the EJBs you also need to activate the admin user account if it is not already activated. To do this, edit the principals.xml file and remove the attribute deactivated="true" from the user tag for the admin user.

    4. Make sure Orion is up and running.

    5. Change directory to the demo/ejb/cart directory.

    6. Start the client by typing the command given in listing 4 below.


    <application name="ejbsamples" path="../demo/ejb" />

    Listing 3: deploying an application


    java -classpath ../../../orion.jar;../../../ejb.jar;../../../jndi.jar CartClient

    Listing 4: Running the Cart client

    (use ':' insted of ';' as path-separator on UNIX)

3 Installing the EJBUserManager

    To install the EJBUserManager, add the following to META-INF/ orion-application.xml:


    <user-manager class="com.evermind.ejb.EJBUserManager">
    <property name="home" value="com.evermind.ejb.EJBUser" />
    <property name="defaultGroups" value="users" />
    </user-manager>
    Listing 5: installing the EJBUserManager

4 Running the News application

    1. Make sure that a valid DataSource is available.

      For information on how to configure a data-source please see this guide.

    2. If the news application is not already deployed this is done by adding the lines given in listing 6 below to the server.xml configuration file found in the config/ directory.

      For more information on how to deploy applications, see this guide.

    3. Bind the web-app to the default site, this is done by adding the lines igven in listing 7 below to the default-web-site.xml configuration file found in the config/ directory.

      For more information on how to bind web-modules, see this guide.

    4. Start Orion up, this should auto-deploy the application.

    5. Access http://localhost/news/ and verify that it works.


    <application name="news" path="../applications/news.ear" />
    Listing 6: Deploying the news application


    <web-app application="news" name="news-web" root="/news" />
    Listing 7: Binding the web-module to the site.

5 Running the ATM application

    The ATM sample application simulates a Automatic Teller Machine. The application uses MDBs, Local interfaces, Session Syncronization, Automatic primary keys, Usermanagement and form-based authentication amongst other tecnhiques.

    1. Make sure that a valid DataSource is available.

      For information on how to configure a data-source please see this guide.

    2. Add a valid mail configuration to the application.xml configuration file found in the config/ directory. A example is given in listing 8 below.

    3. If the ATM application is not already deployed this is done by adding the lines given in listing 9 below to the server.xml configuration file found in the config/ directory.

      For more information on how to deploy applications, see this guide.

    4. Bind the web-app to the default site, this is done by adding the lines igven in listing 10 below to the default-web-site.xml configuration file found in the config/ directory.

      For more information on how to bind web-modules, see this guide.

    5. Start Orion up, this should auto-deploy the application.

    6. Access http://localhost/atm/ and verify that it works.


    <mail-session location="mail/MailSession"
    smtp-host="mail.mycompany.com">
    <property name="mail.transport.protocol"
    value="smtp" />
    <property name="mail.smtp.from"
    value="admin@mycompany.com" />
    <property name="mail.from"
    value="sales@mycompany.com" />
    </mail-session>
    Listing 8: Configuring a mail resource.


    <application name="atm"
    path="../applications/atm.ear" />
    Listing 9: Deploying the ATM application


    <web-app application="atm"
    name="atm-web"
    root="/atm" />
    Listing 10: Binding the web-module to the site.

Copyright © 2005 IronFlare AB