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:
  2.  
    listen                  = ssl://localhost:7243 
    ssl_server_identity     = certs/server.cert.pem 
    ssl_server_key          = certs/server.key.pem 
    ssl_password            = password 
    

Java Security Policy

  1. 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.
  2.  
    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

  1. In a web browser, access Sun’s Java System Administration Tool at http://host:admin_port
  2. In the left frame, navigate the tree to the folder AppServer Instances->server1
  3. In the right frame, click the JVM Settings tab, then the Path Settings link.
  4. In the Classpath Suffix box, enter the following filenames, and click the Save button:
  5. C:\tibco\ems\clients\java\tibjms.jar

    C:\tibco\ems\clients\java\jcert.jar

    C:\tibco\ems\clients\java\jnet.jar

    C:\tibco\ems\clients\java\jsse.jar

    C:\tibco\ems\clients\java\tibcrypt.jar

  6. To propagate these modifications to the server, click the General tab, then the Apply Changes button. Then stop and restart the server instance.
  7. If you are using a console configured in the previous section, omit this step and continue to the next step.
  8. If you have started a new console, change directory to install_dir\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. In all cases, run the following commands in the asadmin interface:
  10.  
    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.se
    curity_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.se
    curity_protocol=ssl:com.tibco.tibjms.naming.ssl_enable_verify_host=false 
    jms/MyQueue 
     
    asadmin>reconfig server1 
     
    
  11. Change directory to install_dir\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.

  1. Add tibjms.jar, jcert.jar, jnet.jar, jsse.jar, and tibcrypt.jar to JVM_CLASSPATH in appclient.bat.

Run

  1. Change directory to install_dir\domains\domain1\server1\applications\j2ee-apps\mdb-simple_1, and run this command:
  2.  
    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

  1. Clean up the build and undeploy the sample MDB.
  2. Change directory to install_dir\Sample\ejb\mdb\Simple\src, and run these commands:

     
    asant clean 
    asant undeploy 
    
  3. Remove the directory: install_dir\domains\domain1\server1\applications\j2ee-apps\mdb-simple_1
  4. Undeploy JNDI resources:
  5.  
    asadmin>delete-jndi-resource jms/MyQcf 
    asadmin>delete-jndi-resource jms/MyQueue 
    asadmin>reconfig server1 
    

TIBCO Enterprise Message Service™ Application Integration Guide
Software Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com