To build the application using Ant, do the following:
Start the Application Server, if it is not already running.
Go to the following directory:
tut-install/javaeetutorial5/examples/jms/clientsessionmdb/
To compile the source files and package the application, use the following command:
ant |
The ant command 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
The clientsessionmdb.ear file is created in the clientsessionmdb/dist directory.
To deploy the application and run the client, use the following command:
ant run |
Ignore the message that states that the application is deployed at a URL.
The client displays these lines:
running application client container. 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. Use the following command:
ant undeploy |
To remove the generated files, use the following command in the clientsessionmdb, clientsessionmdb-app-client, and clientsessionmdb-ejb directories:
ant clean |