Running the demo for a non-clustered instance in NetBeans (I used NetBeans 7.0):

1. Open NetBeans. You'll need to configure NetBeans to know about your GlassFish 3.1 installation if you haven't done so already. To do this, click on the "Services" tab, select the "Servers" node, open the right-mouse menu and choose "Add server..."

2. Then unzip MQDemo.zip into a suitable directory somewhere. In NetBeans, use File --> Open Project to open this project. It will display a message that it can't find the GlassFish installation it has been configured to use, so follow the instructions to resolve this error and make it refer to the GlassFish installation in (1).

3. Build and deploy the MDB: To do this, select the project, open the right-mouse menu and choose "Deploy".

4. Then unzip MQDemoSender.zip and MQDemoReceiver.zip into a suitable directory. In NetBeans, use File --> Open Project to open each project. These will not compile because you don't have the JMS API or the MQ client in your classpath.

To fix this, select the project (you'll need to do this for both)  and open the right-mouse menu.  Select "Properties" to open the Project Properties. Select the "libraries" node, click on the "compile" tab and then
4.1. Click on "Add JAR/Folder" and navigate to mq/lib/mq.jar under the GlassFish installation
4.2. Click on "Add Library" and select "Java EE 6 API Limrary"

5. Start the receiver: Select the MQDemoReceiver project, open the right-mouse menu and select "Run".

6. Start the sender: Select the MQDemSender project, open the right-mouse menu and select "Run".

Look in the output window for the output of the sender, receiver and the MDB.

As an advanced NetBeans exersize, here is a project which contains the Cluster Demonstration -- this uses shows how you can create ant tasks which can be run from within NetBeans. Unzip then open this project in NetBeans. You may need to customize these scripts for your machine setup. We won't have time to go over this in the lab.