Chapter 9 Integrating With Sun Java System Application Server 7 : Run the MDB Sample with TIBCO EMS

Run the MDB Sample with TIBCO EMS
This section demonstrates the procedure for using the sample MDB with EMS.
Configure Application Server
In a web browser, access Sun’s Java System Administration Tool at http://host:admin_port
1.
2.
3.
4.
5.
To propagate these modifications to the server, click the General tab, then the Apply Changes button. Then stop and restart the server instance.
Register JMS Resources with Application Server
6.
Change directory to EMS_HOME\bin, and run these commands:
asadmin multimode
 
asadmin>export AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=password AS_ADMIN_HOST=hostname AS_ADMIN_PORT=port AS_ADMIN_INSTANCE=server
 
asadmin>create-jndi-resource --jndilookupname QueueConnectionFactory --resourcetype javax.jms.QueueConnectionFactory --factoryclass com.tibco.tibjms.naming.TibjmsInitialContextFactory --enabled=true --property java.naming.provider.url=tibjmsnaming\://localhost\:7222 jms/MyQcf
 
asadmin>create-jndi-resource --jndilookupname queue.sample --resourcetype javax.jms.Queue --factoryclass com.tibco.tibjms.naming.TibjmsInitialContextFactory --enabled=true --property java.naming.provider.url=tibjmsnaming\://localhost\:7222 jms/MyQueue
 
asadmin>reconfig server1
Run the Sample
7.
8.
Change directory to EMS_HOME\bin. Modify appclient.bat by adding EMS_HOME\jar\tibjms.jar to JVM_CLASSPATH.
9.
Change directory to EMS_HOME\samples\ejb\mdb\simple\src, then build and deploy the sample using the following commands:
Build
asant
Deploy
asant deploy
 
The server log should indicate that the MDB is successfully deployed.
Run
10.
Change directory to EMS_HOME\domains\domain1\server1\applications\j2ee-apps\mdb-simple_1, and run this command:
 
appclient -client mdb-simpleClient.jar -name SimpleMessageClient -textauth
The console should display these lines:
 
Sending message: This is message 1
Sending message: This is message 2
Sending message: This is message 3
The server log should display these lines:
 
MESSAGE BEAN: Message received: This is message 1
MESSAGE BEAN: Message received: This is message 2
MESSAGE BEAN: Message received: This is message 3
Clean Up
11.
Change directory to EMS_HOME\samples\ejb\mdb\simple\src, and run these commands:
 
asant clean
asant undeploy
12.
Remove the directory: EMS_HOME\domains\domain1\server1\applications\j2ee-apps\mdb-simple_1
13.
 
asadmin>delete-jndi-resource jms/MyQcf
asadmin>delete-jndi-resource jms/MyQueue
asadmin>reconfig server1