To build, deploy, and run the application using NetBeans IDE, do the following:
Start the Application Server, if it is not already running.
In NetBeans IDE, choose Open Project from the File menu.
In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jms/.
Select the clientsessionmdb folder.
Select the Open as Main Project check box and the Open Required Projects check box.
Click Open Project.
Right-click the clientsessionmdb project and choose Build.
This task creates the following:
An application client JAR file that contains the client class file and the session bean’s remote interface, along with a manifest file that specifies the main class
An EJB JAR file that contains both the session bean and the message-driven bean
An application EAR file that contains the two JAR files
Right-click the project and choose Undeploy and Deploy.
Right-click the project and choose Run.
This command returns a JAR file named clientsessionmdbClient.jar and then executes it.
The output of the application client in the Output pane looks like this:
To view the bean output, check <install_dir>/domains/domain1/logs/server.log. |
The output from the enterprise beans appears in the server log (domain-dir/logs/server.log), wrapped in logging information. The Publisher session bean sends two sets of 18 messages numbered 0 through 17. Because of the message selector, the message-driven bean receives only the messages whose NewsType property is Sports or Opinion.
Undeploy the application after you finish running the client. To undeploy the application, follow these steps:
Click the Services tab.
Expand the Servers node.
Expand the Sun Java System Application Server node.
Expand the Applications node.
Expand the Enterprise Applications node.
Right-click clientsessionmdb and choose Undeploy.
To remove the generated files, right-click the clientsessionmdb project and choose Clean.