Topic
  • 1 reply
  • Latest Post - ‏2006-02-13T05:27:04Z by SystemAdmin
SystemAdmin
SystemAdmin
684 Posts

Pinned topic Cannot start memory Qmgr

‏2006-02-11T16:59:11Z |
I have a requirement to create a Qmgr in memort and send message with
encryption turn on.
This is under WINXP with SUN JRE 150.

Here is the fragment of the code that I used to create the Qmgr and start
it.
In order to test the code , I used
"com.ibm.mqe.adapters.MQeDiskFieldsAdapter" to create the Qmgr on disk
first.
This works fine and I can start the QMgr with no problem.
However when I switch to use "com.ibm.mqe.adapters.MQeDiskFieldsAdapter" to
create the Qmgr in memory, I got Qmgr not configured error.
Can some one tell me what I did wrong ?

Here is the code to create and start the Qmgr. This is not the complete
program.
The program takes a parameter which is the name of the Qmgr
============================================================================
======

public void define(String queueManagerName) throws Exception {

System.out.println("Defining the queue manager." +
queueManagerName);

this.queueManagerName = queueManagerName;
baseDirectoryName = "C:/MyQueueManagers/" + queueManagerName;

myMemory = new com.ibm.mqe.adapters.MQeMemoryFieldsAdapter();

// Create all the configuration information needed to construct the
// queue manager in memory.
config = new MQeFields();

// Construct the queue manager section parameters.
MQeFields queueManagerSection = new MQeFields();

queueManagerSection.putAscii(MQeQueueManager.Name,
queueManagerName);
config.putFields(MQeQueueManager.QueueManager, queueManagerSection);
// Construct the registry section parameters.
// In this examples, we use a public registry.
MQeFields registrySection = new MQeFields();

//==== For private registry

registrySection.putAscii(MQeRegistry.LocalRegType,"com.ibm.mqe.registry.MQeP
rivateSession");
registrySection.putAscii(MQeRegistry.PIN, "kings1on");
//===

registrySection.putAscii(MQeRegistry.Adapter,
MEMORY_ADAPTER_CLASS_NAME);
registrySection.putAscii(MQeRegistry.DirName, baseDirectoryName +
"/Registry");

config.putFields("Registry", registrySection);

MQeQueueManagerConfigure configurator = new
MQeQueueManagerConfigure(config,
"com.ibm.mqe.adapters.MQeMemoryFieldsAdapter" + ":" + baseDirectoryName +
"/Queues");

configurator.setChnlAttributeRuleName("ChannelAttrRules");
configurator.defineQueueManager();

configurator.defineDefaultAdminQueue();
configurator.defineDefaultAdminReplyQueue();
configurator.defineDefaultDeadLetterQueue();
configurator.defineDefaultSystemQueue();

configurator.close();

System.out.println(queueManagerName + "using" +config " " "
created.");
}

/**
* Starts the in-memory queue manager.
*/
public void start() throws Exception {
System.out.println("Starting the queue manager");
myQueueManager = new MQeQueueManager();

MQeFields queueManagerSection = new MQeFields();

queueManagerSection.putAscii(MQeQueueManager.Name,
queueManagerName);
config.putFields(MQeQueueManager.QueueManager, queueManagerSection);
MQeFields registryParameters = new MQeFields();

registryParameters.putAscii(MQeRegistry.DirName, baseDirectoryName +
"/Registry");
// the following two lines are required for a private registry
registryParameters.putAscii(MQeRegistry.LocalRegType,
"PrivateRegistry");
registryParameters.putAscii(MQeRegistry.PIN, "kings1on");

config.putFields(MQeQueueManager.Registry, registryParameters);

System.out.println("Start Queue manager using" + config);

myQueueManager.activate(config);
System.out.println("Queue manager started.");
}

Here is my compile and run output:
===========================================================================
F:\>javac Mypgm.java

F:>java Mypgm mm9

Defining the queue manager.mm9
Queue manager mm9 in memory created.

Starting the queue manager
Start Queue manager using(30377347)
... nested fields Registry
(ascii) PIN = kings1on
(ascii) LocalRegType = PrivateRegistry
(ascii) DirName = C:/MyQueueManagers/mm9/Registry
... nested fields QueueManager
(ascii) Name = mm9

Error: com.ibm.mqe.MQeException: Queue Manager not configured[1] (code=113)
com.ibm.mqe.MQeException: Queue Manager not configured[1] (code=113)
at com.ibm.mqe.MQeQueueManager._processRegistry(DashoA8173)
Updated on 2006-02-13T05:27:04Z at 2006-02-13T05:27:04Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    684 Posts

    Re: Cannot start memory Qmgr

    ‏2006-02-13T05:27:04Z  
    Hi Kelvin,
    Pls modify the start() method with following one line.
    registrySection.putAscii(MQeRegistry.Adapter,
    MEMORY_ADAPTER_CLASS_NAME);

    In define() method you have this line.But in start() method you are
    missing this.
    If this line is not present,then by default Registry will be looked in
    file system because MQeDiskFieldsAdapter is used as default adapter.

    regards,
    Vijay

    "Kelvin Yung" <kyung@ca.ibm.com> wrote in message
    news:dsl557$2kg76$2@news.boulder.ibm.com...
    > I have a requirement to create a Qmgr in memort and send message with
    > encryption turn on.
    > This is under WINXP with SUN JRE 150.
    >
    > Here is the fragment of the code that I used to create the Qmgr and start
    > it.
    > In order to test the code , I used
    > "com.ibm.mqe.adapters.MQeDiskFieldsAdapter" to create the Qmgr on disk
    > first.
    > This works fine and I can start the QMgr with no problem.
    > However when I switch to use "com.ibm.mqe.adapters.MQeDiskFieldsAdapter"
    to
    > create the Qmgr in memory, I got Qmgr not configured error.
    > Can some one tell me what I did wrong ?
    >
    > Here is the code to create and start the Qmgr. This is not the complete
    > program.
    > The program takes a parameter which is the name of the Qmgr
    >
    ============================================================================
    > ======
    >
    > public void define(String queueManagerName) throws Exception {
    >
    > System.out.println("Defining the queue manager." +
    > queueManagerName);
    >
    > this.queueManagerName = queueManagerName;
    > baseDirectoryName = "C:/MyQueueManagers/" + queueManagerName;
    >
    > myMemory = new com.ibm.mqe.adapters.MQeMemoryFieldsAdapter();
    >
    > // Create all the configuration information needed to construct
    the
    > // queue manager in memory.
    > config = new MQeFields();
    >
    > // Construct the queue manager section parameters.
    > MQeFields queueManagerSection = new MQeFields();
    >
    > queueManagerSection.putAscii(MQeQueueManager.Name,
    > queueManagerName);
    > config.putFields(MQeQueueManager.QueueManager,
    queueManagerSection);
    >
    >
    > // Construct the registry section parameters.
    > // In this examples, we use a public registry.
    > MQeFields registrySection = new MQeFields();
    >
    > //==== For private registry
    >
    >
    registrySection.putAscii(MQeRegistry.LocalRegType,"com.ibm.mqe.registry.MQeP
    > rivateSession");
    > registrySection.putAscii(MQeRegistry.PIN, "kings1on");
    > //===
    >
    > registrySection.putAscii(MQeRegistry.Adapter,
    > MEMORY_ADAPTER_CLASS_NAME);
    > registrySection.putAscii(MQeRegistry.DirName, baseDirectoryName +
    > "/Registry");
    >
    > config.putFields("Registry", registrySection);
    >
    > MQeQueueManagerConfigure configurator = new
    > MQeQueueManagerConfigure(config,
    > "com.ibm.mqe.adapters.MQeMemoryFieldsAdapter" + ":" + baseDirectoryName +
    > "/Queues");
    >
    > configurator.setChnlAttributeRuleName("ChannelAttrRules");
    > configurator.defineQueueManager();
    >
    > configurator.defineDefaultAdminQueue();
    > configurator.defineDefaultAdminReplyQueue();
    > configurator.defineDefaultDeadLetterQueue();
    > configurator.defineDefaultSystemQueue();
    >
    > configurator.close();
    >
    > System.out.println(queueManagerName + "using" +config " " "
    > created.");
    > }
    >
    > /**
    > * Starts the in-memory queue manager.
    > */
    > public void start() throws Exception {
    > System.out.println("Starting the queue manager");
    > myQueueManager = new MQeQueueManager();
    >
    > MQeFields queueManagerSection = new MQeFields();
    >
    > queueManagerSection.putAscii(MQeQueueManager.Name,
    > queueManagerName);
    > config.putFields(MQeQueueManager.QueueManager,
    queueManagerSection);
    >
    >
    > MQeFields registryParameters = new MQeFields();
    >
    > registryParameters.putAscii(MQeRegistry.DirName, baseDirectoryName
    +
    > "/Registry");
    > // the following two lines are required for a private registry
    > registryParameters.putAscii(MQeRegistry.LocalRegType,
    > "PrivateRegistry");
    > registryParameters.putAscii(MQeRegistry.PIN, "kings1on");
    >
    > config.putFields(MQeQueueManager.Registry, registryParameters);
    >
    > System.out.println("Start Queue manager using" + config);
    >
    > myQueueManager.activate(config);
    > System.out.println("Queue manager started.");
    > }
    >
    > Here is my compile and run output:
    >
    ===========================================================================
    > F:\>javac Mypgm.java
    >
    > F:>java Mypgm mm9
    >
    > Defining the queue manager.mm9
    > Queue manager mm9 in memory created.
    >
    > Starting the queue manager
    > Start Queue manager using(30377347)
    > ... nested fields Registry
    > (ascii) PIN = kings1on
    > (ascii) LocalRegType = PrivateRegistry
    > (ascii) DirName = C:/MyQueueManagers/mm9/Registry
    > ... nested fields QueueManager
    > (ascii) Name = mm9
    >
    > Error: com.ibm.mqe.MQeException: Queue Manager not configured[1]
    (code=113)
    > com.ibm.mqe.MQeException: Queue Manager not configured[1] (code=113)
    > at com.ibm.mqe.MQeQueueManager._processRegistry(DashoA8173)
    >
    >