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

Run the MDB Sample with TIBCO EMS using SSL
Configure the EMS Server
1.
Ensure that these parameters are set in tibemsd.conf before starting the EMS server:
 
listen = ssl://localhost:7243
ssl_server_identity = certs/server.cert.pem
ssl_server_key = certs/server.key.pem
ssl_password = password
Java Security Policy
2.
If you use the default installation (and depending on the local Java setting), you must grant the following permissions in your J2SDK policy file /jre/lib/security/java.policy.
 
permission java.util.PropertyPermission "com.sun.net.ssl.dhKeyExchangeFix", "write";
 
permission java.util.PropertyPermission "java.protocol.handler.pkgs", "write";
 
permission java.security.SecurityPermission "putProviderProperty.SunJSSE";
 
permission java.security.SecurityPermission "insertProvider.SunJSSE";
Configure Application Server
3.
4.
5.
6.
   EMS_HOME\jar\tibjms.jar
   EMS_HOME\jar\tibcrypt.jar
 
7.
To propagate these modifications to the server, click the General tab, then the Apply Changes button. Then stop and restart the server instance.
8.
If you have started a new console, 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=localhost AS_ADMIN_PORT=4848 AS_ADMIN_INSTANCE=server1
 
9.
 
asadmin>create-jndi-resource --jndilookupname SSLQueueConnectionFactory --resourcetype javax.jms.QueueConnectionFactory --factoryclass com.tibco.tibjms.naming.TibjmsInitialContextFactory --enabled=true --property java.naming.provider.url=tibjmsnaming\://localhost\:7243:com.tibco.tibjms.naming.security_protocol=ssl:com.tibco.tibjms.naming.ssl_enable_verify_host=false 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\:7243:com.tibco.tibjms.naming.security_protocol=ssl:com.tibco.tibjms.naming.ssl_enable_verify_host=false jms/MyQueue
 
asadmin>reconfig server1
 
10.
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.
11.
Add tibjms.jar and tibcrypt.jar to JVM_CLASSPATH in appclient.bat.
Run
12.
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
13.
Change directory to EMS_HOME\samples\ejb\mdb\Simple\src, and run these commands:
 
asant clean
asant undeploy
14.
Remove the directory: EMS_HOME\domains\domain1\server1\applications\j2ee-apps\mdb-simple_1
15.
 
asadmin>delete-jndi-resource jms/MyQcf
asadmin>delete-jndi-resource jms/MyQueue
asadmin>reconfig server1