To package the modules using NetBeans IDE, perform these steps:
In NetBeans IDE, choose Open Project from the File menu.
In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jms/consumeremote/.
Select the earthmdb folder.
Select the Open as Main Project check box.
Click Open Project.
Right-click the earthmdb project and choose Build.
This command creates a JAR file that contains the bean class file and the sun-ejb-jar.xml deployment descriptor file.
Choose Open Project from the File menu.
Select the jupiterclient folder.
Select the Open as Main Project check box.
Click Open Project.
Right-click the jupiterclient project and choose Build.
This target creates a JAR file that contains the client class file and a manifest file.
To deploy the earthmdb module and run the application client, perform these steps:
Right-click the earthmdb project and choose Set as Main Project.
Right-click the earthmdb project and choose Undeploy and Deploy.
Copy the jupiterclient module to the remote system (jupiter):
In a terminal window, change to the directory tut-install/javaeetutorial5/examples/jms/consumeremote/jupiterclient/dist/.
Type a command like the following:
cp jupiterclient.jar F:/ |
That is, copy the client JAR file to a location on the remote filesystem.
Go to the directory on the remote system where you copied the client JAR file.
Use the following command:
appclient -client jupiterclient.jar |
On jupiter, the output of the appclient command looks like this:
Sending message: This is message 1 Sending message: This is message 2 Sending message: This is message 3 |
On earth, the output in the server log looks something like this (wrapped in logging information):
MESSAGE BEAN: Message received: This is message 1 MESSAGE BEAN: Message received: This is message 2 MESSAGE BEAN: Message received: This is message 3 |
Undeploy the message-driven bean after you finish running the client. To undeploy the earthmdb module, perform these steps:
Click the Services tab.
Expand the Servers node.
Expand the Sun Java System Application Server node.
Expand the Applications node.
Expand the EJB Modules node.
Right-click earthmdb and choose Undeploy.
To remove the generated files, follow these steps:
Right-click the earthmdb project and choose Clean.
In the command line window from which you copied the client JAR file, go to a directory other than the jupiterclient/dist directory.
Right-click the jupiterclient project and choose Clean.
You can also delete the jupiterclient.jar file from the remote filesystem.