To edit the message-driven bean source file and then package, deploy, and run the modules using NetBeans IDE, follow these steps.
In NetBeans IDE, select File->Open Project.
In the Open Project dialog, navigate to:
tut-install/examples/jms/consumeremote/ |
Select the earthmdb folder.
Select the Open as Main Project check box.
Click Open Project.
Edit the MessageBean.java file as follows:
In the Projects tab, expand the earthmdb, Source Packages, and mdb nodes, then double-click MessageBean.java.
Find the following line within the @MessageBean annotation:
@ActivationConfigProperty(propertyName = "addressList", propertyValue = "remotesystem"),
Replace remotesystem with the name of your remote system.
Right-click the earthmdb project and select Build.
This command creates a JAR file that contains the bean class file.
Select File->Open Project.
Select the jupiterclient folder.
Select the Open as Main Project check box.
Click Open Project.
In the Projects tab, right-click the jupiterclient project and select Build.
This target creates a JAR file that contains the client class file and a manifest file.
Right-click the earthmdb project and select Deploy.
To copy the jupiterclient module to the remote system, follow these steps:
To run the application client, follow these steps:
Go to the directory on the remote system (jupiter) where you copied the client JAR file.
To deploy the client module and retrieve the client stubs, use the following command:
asadmin deploy --retrieve . jupiterclient.jar |
This command deploys the client JAR file and retrieves the client stubs in a file named jupiterclientClient.jar
To run the client, use the following command:
appclient -client jupiterclientClient.jar |
On jupiter, the output of the appclient command looks like this (preceded by application client container output):
Sending message: This is message 1 from jupiter Sending message: This is message 2 from jupiter Sending message: This is message 3 from jupiter |
On earth, the output in the server log looks something like this (preceded by logging information):
MESSAGE BEAN: Message received: This is message 1 from jupiter MESSAGE BEAN: Message received: This is message 2 from jupiter MESSAGE BEAN: Message received: This is message 3 from jupiter |