The Java EE 6 Tutorial

ProcedureTo Create Administered Objects for Multiple Systems

To run these clients, you must do the following:

You do not have to install the tutorial examples on both systems, but you must be able to access the filesystem where it is installed. You may find it more convenient to install the tutorial examples on both systems if the two systems use different operating systems (for example, Windows and Solaris). Otherwise you will have to edit the file tut-install/examples/bp-project/build.properties and change the location of the javaee.home property each time you build or run a client on a different system.

  1. Start the GlassFish Server on earth.

  2. Start the GlassFish Server on jupiter.

  3. To create a new connection factory on jupiter, follow these steps:

    1. From a command shell on jupiter, go to the directory tut-install/examples/jms/simple/producer/.

    2. Type the following command:


      ant create-local-factory
      

      The create-local-factory target, defined in the build.xml file for the Producer example, creates a connection factory named jms/JupiterConnectionFactory.

  4. To create a new connection factory on earth that points to the connection factory on jupiter, follow these steps:

    1. From a command shell on earth, go to the directory tut-install/examples/jms/simple/producer/.

    2. Type the following command:


      ant create-remote-factory -Dsys=remote-system-name
      

      Replace remote-system-name with the actual name of the remote system.

      The create-remote-factory target, defined in the build.xml file for the Producer example, also creates a connection factory named jms/JupiterConnectionFactory. In addition, it sets the AddressList property for this factory to the name of the remote system.

  5. If you have already been working on either earth or jupiter, you have the queue and topic on one system. On the system that does not have the queue and topic, type the following command:


    ant create-resources