Weblogic Foreign JMS Server Configuration With MQ Series

–    Create a JMS server target it to the admin server as below:

–    Create a JMS module and add the resource Foreign Server as below:

– Go to the ForeignServer-> Configuration-> General and edit it as below:
JNDI Initial Context Factory: com.sun.jndi.fscontext.RefFSContextFactory
JNDI Connection URL: file:/C:/JNDI-Directory
It looks like:

–    Go to Configurations -> Destinations-> Click on new.
Give the Local JNDI name as the JNDI which is on the weblogic side and is in the deployment descriptors of the MDB. The remote JNDI name will be the queue names which are on the MQ side.
It looks like:

–   Go to Configurations -> connection factory and click on new.
The local JNDI name will be the connection factory name in the deployment descriptors of the MDB and the remote connection factory will be the one on MQ side.

It looks like:

–    Note: These destinations are logical entities and not actually present. These destinations cannot be monitored.

This is an example of the MDB and the foreign JMS server being on the same domain and the same server. Deploy your MDB on the same server on which the JMS server is targeted. In this case it is the admin server. The deployed MDB will look like below:

Configurations in the MDB according to the screen shots will be:

– weblogic-ejb-jar.xml file: (example of destination queue)


Below are the configurations from MQ side that need to be done so that the MQ can bind with the weblogic server:

– Create a folder in C: drive with the name JNDI-Directory (mention the drive/path where you have MQ installed)

– Create a file named MyAdmin.config in the path “C:Program FilesIBMWebSphere MQJavabin”, write the below in the file:


– Copy all the MQ related jars in the classpath of the server:
set classpath=”C:Program FilesIBMWebSphere MQJavalibcom.ibm.mq.jar;C:Program FilesIBMWebSphere MQJavalibcom.ibm.mq.jms.Nojndi.jar;C:Program FilesIBMWebSphere MQJavalibcom.ibm.mq.soap.jar;C:Program FilesIBMWebSphere MQJavalibcom.ibm.mqjms.jar;C:Program FilesIBMWebSphere MQJavalibconnector.jar;C:Program FilesIBMWebSphere MQJavalibfscontext.jar;C:Program FilesIBMWebSphere MQJavalibfscontext.jar”;%CLASSPATH%

To create and run the MQ queue manager, below are the commands:
– C:Program FilesIBMWebSphere MQJavabin>crtmqm testqmgr
– C:Program FilesIBMWebSphere MQJavabin>strmqm testqmgr
– C:Program FilesIBMWebSphere MQJavabin>runmqsc testqmgr

– To create the connection factory and the queues on MQ as per your naming requirement.
Go to the command prompt and go to the below path:

C:Program FilesIBMWebSphere MQJavabin

– Ensure that you have a MyAdmin.Config file in the above path in your system.

– Type the command JMSAdmin.bat -cfg MyAdmin.config and you will see InitCtx> in the prompt shell.

Examples of creating connection factory and queue:

InitCtx> def xaqcf(ReceiverQCF) qmgr(testqmgr)


– Now check the bindings of weblogic with the MQ as below:

InitCtx> display ctx

Contents of InitCtx

.bindings                 java.io.File
a  ReceiverQCF               com.ibm.mq.jms.MQXAQueueConnectionFactory
a  J3.Q0038.V3               com.ibm.mq.jms.MQQueue
a  J3.Q0015.V3               com.ibm.mq.jms.MQQueue
a  J3.Q0002.V3               com.ibm.mq.jms.MQQueue

5 Object(s)
0 Context(s)
5 Binding(s), 4 Administered

Check if the bindings file is created in the JNDI-Directory folder.


  1. Hi-

    As part of our integration project, following are our requirements:
    1. We have to integrate IBM Maximo Application to a 3rd Party application using OSB 11g as the Middleware. IBM Maximo Application is installed on top of Weblogic server
    2. Source Application IBM Maximo will enqueue a Business Message to a JMS Queue which resides within the IBM Maximo Application
    3. OSB should dequeue the message, validate, transform and finally insert the data into staging tables of the 3rd Party Application

    Clarifications/Inputs Required
    1. Can OSB connect to the JMS Queue which resides within the IBM Maximo Application? If yes can you please provide any documents/link which outlines the steps.
    2. What information do we need to configure OSB to connect to the JMS Queue? Do I need to configure a Messaging Bridge or a Foreign JNDI provider in Weblogic

    Kindly provide your inputs.

    Thanks in advance for your time and help

    Best Regards,

  2. I am looking for a resource to configure a MQ JCA Adapter to configure a connection factory ,admin objects and consequently a message bridge using them .Can I use the JCA 1.5 resource adapter provided by MQ Series to configure a foriegn server and use the CF and denstination object so created in my message bridge from weblogic to MQ 7 server without using the admin objects .I have experience with the same in Jboss 5 by creating a ra-ds.xml file and configuring the MQ details like channel name etc and it worked flawlessly.

Comments are closed.