To package the modules using Ant, perform these steps:
Go to the following directory:
tut-install/javaeetutorial5/examples/jms/consumeremote/earthmdb/
Type the following command:
ant |
This command creates a JAR file that contains the bean class file and the sun-ejb-jar.xml deployment descriptor file.
Go to the jupiterclient directory:
cd ../jupiterclient |
Type the following command:
ant |
This target creates a JAR file that contains the client class file and a manifest file.
To deploy the earthmdb module, perform these steps:
Change to the directory earthmdb:
cd ../earthmdb |
Type the following command:
ant deploy |
To copy the jupiterclient module to the remote system, perform these steps:
Change to the directory jupiterclient/dist:
cd ../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.
To run the client, perform the following steps:
Go to the directory on the remote system (jupiter) 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:
Change to the directory earthmdb.
Type the following command:
ant undeploy |
You can also delete the jupiterclient.jar file from the remote filesystem.
To remove the generated files, use the following command in both the earthmdb and jupiterclient directories:
ant clean |