Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer Messaging resources > Manage messaging with the default messaging provider > Use JMS from stand-alone clients to interoperate with service integration resources > Use JMS to connect to a WAS default messaging provider messaging engine


Obtaining WebSphere MQ JMS resources in the thin client environment

A stand-alone Java SE JMS thin client application that connects to an external WebSphere MQ queue manager can get administratively-created WebSphere MQ messaging provider JMS resources from the WAS JNDI namespace.


Procedure

  1. To obtain WebSphere MQ messaging provider JMS resources from the WAS JNDI namespace in the thin client environment, include the following jar files in the runtime classpath of the application:

    • A copy of the /runtimes/com.ibm.ws.ejb.thinclient_7.0.0.jar file.
    • A copy of the /runtimes/com.ibm.ws.messagingClient.jar file.
    • WebSphere MQ client jar files, which must be obtained from the WebSphere MQ product.

  2. Use the following code to create a suitable Initial Context, substituting the server IP address and port as appropriate:
    import javax.naming.*;
    ...
    Properties env = new Properties();
    env.put(Context.PROVIDER_URL,"iiop:
      //
    <server IP address>:
    <server bootstrap address port>");
    env.put(Context.INITIAL_CONTEXT_FACTORY,   "com.ibm.websphere.naming.WsnInitialContextFactory");
    InitialContext ctx = new InitialContext(env);
    
    In certain situations, for example when running with a Sun JRE, an additional ORB jar is also required. For additional information about when this jar is required, see the Thin Client for EJB with WAS information.


Run the IBM Thin Client for EJB

+

Search Tips   |   Advanced Search