ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Newbie Question:

Post new topic  Reply to topic
 Newbie Question: « View previous topic :: View next topic » 
Author Message
RandyWatson
PostPosted: Wed Aug 06, 2003 10:15 am    Post subject: Newbie Question: Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Wed Aug 06, 2003 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
rashidg
PostPosted: Wed Aug 06, 2003 9:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
RandyWatson
PostPosted: Thu Aug 07, 2003 5:13 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Thu Aug 07, 2003 6:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
RandyWatson
PostPosted: Thu Aug 07, 2003 9:01 am    Post subject: Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Thu Aug 07, 2003 11:59 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Yes:

You can use the JMSAdmin tool on Solaris too.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Newbie Question:
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.