The Java EE 6 Tutorial

ProcedureTo Edit, Build, Package, Deploy, and Run the Clients Using NetBeans IDE

These steps assume that you have the tutorial installed on both of the two systems you are using and that you are able to access the file system of jupiter from earth or vice versa. You will edit the source files to specify the new connection factory. Then you will rebuild and run the clients. Follow these steps.

  1. To edit the source files, follow these steps:

    1. On earth,, open the following file in NetBeans IDE:

      tut-install/examples/jms/simple/producer/src/java/Producer.java
      
    2. Find the following line:

      @Resource(lookup = "jms/ConnectionFactory")
    3. Change the line to the following:

      @Resource(lookup = "jms/JupiterConnectionFactory")
    4. On jupiter, open the following file inNetBeans IDE:

      tut-install/examples/jms/simple/synchconsumer/src/java/SynchConsumer.java
      
    5. Repeat Step b and Step c.

  2. To recompile and repackage the Producer example on earth, right-click the producer project and select Clean and Build.

  3. To recompile and repackage the SynchConsumer example on jupiter, right-click the synchconsumer project and select Clean and Build.

  4. On earth, deploy and run Producer. Follow these steps:

    1. Right-click the producer project and select Properties.

    2. Select Run from the Categories tree.

    3. In the Arguments field, type the following:


      queue 3
      
    4. Click OK.

    5. Right-click the project and select Run.

  5. On jupiter, run SynchConsumer. Follow these steps:

    1. Right-click the synchconsumer project and select Properties.

    2. Select Run from the Categories tree.

    3. In the Arguments field, type the following:


      queue
      
    4. Click OK.

    5. Right-click the project and select Run.