Cant lookup a TopicConnectionFactory using RefFSContextFactory

Advertisement
I am using MQ 5.3 and Websphere 4.0.
I can successfully use JMSAdmin to load my objects into a local file. I have a TopicConnectionFactory called myTCF, and a Topic called Java.
Here is my JMSAdmin.config entries:
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:/C:/tmp
Here is my setup file for JMSAdmin:
def ctx(mq)
chg ctx(mq)
def tcf(MyTCF) qmgr(QM1)
def t(Java) topic(computers/Java)
display ctx
end
This creates a .bindings file int the c:\tmp\mq directory. Here is a piece of the file:
#This file is used by the JNDI FSContext.
#Fri Oct 24 10:30:44 EDT 2003
Java/RefAddr/10/Encoding=String
Java/RefAddr/9/Encoding=String
MyTCF/RefAddr/23/Encoding=String
MyTCF/RefAddr/12/Content=5000
MyTCF/RefAddr/23/Content=1
MyTCF/RefAddr/10/Type=MBS
MyTCF/RefAddr/7/Type=SPAG
MyTCF/RefAddr/10/Content=10
MyTCF/RefAddr/10/Encoding=String
Java/FactoryName=com.ibm.mq.jms.MQTopicFactory
MyTCF/RefAddr/21/Content=60000
MyTCF/RefAddr/21/Type=SRI
MyTCF/RefAddr/12/Encoding=String
MyTCF/RefAddr/1/Type=TRAN
Java/RefAddr/5/Type=TC
My code to reference these objects can read the initial context (mq), but I cant seem to lookup these objects. I use the same InitalContextFactory and ProviderURL, but my ctx.lookup() keeps failing with javax.naming.NameNotFoundException.
I tried mq/myTCF, mq.myTCF, myTCF, jms/mq/myTCF, ect.
Am I using the right syntax for this TopicConnectionFactory?
Any help would be greatly appreciated.
Thanks.
Carl
Advertisement

Replay

I found my own problem.
The provider URL needed to have "/mq" added:
ProviderURL = file:/C:/tmp/mq
This is odd, since my JMSAdmin provider URL, only had the /tmp.....
The lookup() variables should be:
Hopefully this will be a good example for someone else....
MyTCF
Java