Setting up Object Stores and Connector Factories
Using Open MQ 4.0 by itself ( without any other SJES component ).
I am a bit confused on setting up the Object Stored and Connection Factories.
What I have done so far, via the imqadmin GUI console:
1) Setup via the GUI a file-based object store:
http://docs.sun.com/source/819-2571/adminobj.html
http://docs.sun.com/source/819-2571/quick-start.html#wp39312
Basically, I have the following properties against the object store named "ObjectStoreLabel":
java.naming.factory.initial = com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url = /opt/sun/mq/var/adminobjects
The directory /opt/sun/mq/var/adminobjects exists and is owned by root, and imqadmin is also running as root.
After that, imqadmin GUI shows "Destinations" and "Connection Factories" under the object store "ObjectStoreLabel". Even if I exit imqadmin and restart it again, it already knows about it . Where was this configuration stored by imqadmin ?
And then, if I "connect" to the object store, I get:
Unable to connect to the object store "ObjectStoreLabel":
com.sun.messaging.jmq.admin.objstore.GeneralNamingException: A general naming exception is caught
Finally ... how does MQ know about these object stores anyway ? Or am I right in that the object store simply provides a JNDI environment to do lookup, since u need a JNDI provider to connect to a JMS provider ? In essence, the broker does not really care about the object store ?
[1512 byte] By [
j.salvo] at [2007-11-26 8:03:15]

# 1
> After that, imqadmin GUI shows "Destinations" and "Connection Factories" under
> the object store "ObjectStoreLabel". Even if I exit imqadmin and restart it again, it
> already knows about it . Where was this configuration stored by imqadmin ?
OK ... I now know where imqadmin stores its known brokers and object stores. Found out via strace -f imqadmin:
~ /.imq/admin/objstorelist.properties
~ /.imq/admin/brokerlist.properties
Still not sure what to do with the exception when "connecting" to the object store though.
# 2
OK .. Found more info.
This time using imqobjmgr. Looks like it does not like the value for "java.naming.factory.initial":
Warning: The JNDI Naming Service Property 'java.naming.factory.initial'
was not provided through imqobjmgr.
Warning: The JNDI Naming Service Property 'java.naming.provider.url'
was not provided through imqobjmgr.
Listing all administered objects in the object store specified by:
Error [A3050]: imqobjmgr does not recognize the value of java.naming.factory.initial property.
Object list failed.
What should the value be then ?
# 3
I deleted the object store via imqadmin .... then tried imqobjmgr -list again .. still complaining of "mqobjmgr does not recognize the value of java.naming.factory.initial property."
Doing strace -f imqobjmgr ... it seems to be looking for jndi.properties:
[pid 31360] open("/usr/java/jdk1.5.0_04/jre/lib/jndi.properties", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
... which does not exist.
What is one to do ?
# 4
Never mind ... got it all sorted out.
bin/imqobjmgr \
-j java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory \
-j java.naming.provider.url=file:///opt/sun/mq/var/adminobjects \
list
I actually thought that imqobjmgr was reading the same files as imqadmin ( the files under ~/.imq/brokerlist.properties ), which was one mistaken assumption.
Furthermore, the reason imqadmin was unable to "connect" to the object store was that I specified file://, when it should be file:///
John