Author |
Message
|
RandyWatson |
Posted: Wed Aug 06, 2003 10:15 am Post subject: Newbie Question: |
|
|
Newbie
Joined: 06 Aug 2003 Posts: 3
|
Hello All...
I have been assigned a task at work to convert Java MQSeries to JNDI/JMS. The MQ resides on the mainframe and I am coding on my local workstation. I have the server variables (host, port, channel, queue, etc) Looking at the existing code(which is currently in production) I see the following:
MQEnvironment.hostname = mq_host;
MQEnvironment.port = mq_port;
MQEnvironment.channel = channel;
qMgr = new MQQueueManager("");
int options = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_FAIL_IF_QUIESCING;
Queue = qMgr.accessQueue(lqueue,options,null,null,null);
A few questions:
1) does anything need to be configured on the MQ server to allow JNDI/JMS before I begin?
2) I am having trouble setting the correct values in the InitalContext. I am currently using com.sun.jndi.fscontext.RefFSContextFactory as the Context.INITIAL_CONTEXT_FACTORY, but what would be the syntax for the URL provided I have the parameters listed above?
3) Where does the "channel" fit into all this. I can not find it mentioned in the documentation?
4)Am I going about this all wrong? Provided my setup above, is there a better context factory to use?
Any help would be appriecated. Thanks in advance.
Spencer |
|
Back to top |
|
 |
vennela |
Posted: Wed Aug 06, 2003 1:07 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
1) does anything need to be configured on the MQ server to allow JNDI/JMS before I begin? |
NO
Quote: |
2) I am having trouble setting the correct values in the InitalContext. I am currently using com.sun.jndi.fscontext.RefFSContextFactory as the Context.INITIAL_CONTEXT_FACTORY, but what would be the syntax for the URL provided I have the parameters listed above? |
URL is the absolute path for the file name. This file should exist before you run the JMSAdmin tool.
Quote: |
3) Where does the "channel" fit into all this. I can not find it mentioned in the documentation? |
This you give while defining the QueueConnectionFactory.
Quote: |
4)Am I going about this all wrong? Provided my setup above, is there a better context factory to use?
|
You are on the right track. File System Context should be fine. |
|
Back to top |
|
 |
rashidg |
Posted: Wed Aug 06, 2003 9:39 pm Post subject: |
|
|
Novice
Joined: 03 Mar 2002 Posts: 19
|
I also did configuration using file base. Some important steps for the configuration is -
First bind the object in the JNDI tree. Here
1. Create the directory for JNDI URL : e.g c:\jndi
2. Run from command prompt -
c:\> ivtSetup
Before running make sure JMSAdmin.config file is in the PATH so that command ivtSetup can read and find the path where to place the binding file. Or ivtsetup command fromt he directory which contains JMSAdmin.config file.
Content of JMSAdmin.config.txt is
--- INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
--- PROVIDER0_URL=file:C:\\\jndi
--- SECURITY_AUTHENTICATION=none
A file is create in the directory c:\jndi with the name .binding
3. Run from the command prompt -
JMSAdmin -v -cfg C:\bea\wlserver6.1\config\mqsetup\MQSeries\JMSAdmin.config.txt
You can get the properties of the queue and connection factory as
InitialContext> display q(ivtQ)
InitialContext> display qcf(ivtQCF)
InitialContext> dis ctx
*** Actaully this step is not required this is only to verify and check whether obj is in the JNDI tree are not
I hope this will work
Rashid
SCJP
BEA Certified Develooper for Weblogic Server |
|
Back to top |
|
 |
RandyWatson |
Posted: Thu Aug 07, 2003 5:13 am Post subject: |
|
|
Newbie
Joined: 06 Aug 2003 Posts: 3
|
Thanks for the replies.
Ok that seems to be my problem. I do not have JMSAdmin installed at all. In fact I did not know I need to run any type of admin tool for this code to work correctly. I am using Eclipse to develop the code and simply included the jars in my project references. The MQ is already configured and up and running. I have a closed shell environment at work so I requested the MQSeries SDK w/ JMS be installed, hopefully that will include it. Thanks again.
Spencer |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Aug 07, 2003 6:26 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
When you say Eclipse, do you mean Eclipse or WSAD? If you are using WSAD, you can create a test server and then use its admin console to define your JMS resources. |
|
Back to top |
|
 |
RandyWatson |
Posted: Thu Aug 07, 2003 9:01 am Post subject: |
|
|
Newbie
Joined: 06 Aug 2003 Posts: 3
|
Unfortunatly, I am using the freeware Eclipse version 2.1.0
Another question though, this JMSAdmin tool that I need to setup my JNDI configuration information. I take it I need to run the same thing on the production Solaris machine after this code is compiled and transfered?
Thanks to all
Spencer |
|
Back to top |
|
 |
vennela |
Posted: Thu Aug 07, 2003 11:59 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Yes:
You can use the JMSAdmin tool on Solaris too. |
|
Back to top |
|
 |
|