> 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. | In the left frame, navigate the tree to the folder AppServer Instances > server1

> 2. | In the right frame, click the JVM Settings tab, then the Path Settings link.

> 3. | In the Classpath Suffix box, enter the filename EMS_HOME\jar\tibjms.jar

> 4. | Click the Save button.

> 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. | Ensure that the EMS server is running with the default configuration.

> 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-s imple_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. | Clean up the build and undeploy the sample MDB.

> 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-s imple_1

> 13. | Undeploy JNDI resources:

> asadmin>delete-jndi-resource jms/MyQcf
> asadmin>delete-jndi-resource jms/MyQueue
> asadmin>reconfig server1

Copyright © TIBCO Software Inc. All Rights Reserved.