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 » Problem running JMSAdmin.bat?

Post new topic  Reply to topic
 Problem running JMSAdmin.bat? « View previous topic :: View next topic » 
Author Message
viki
PostPosted: Tue Feb 07, 2006 8:19 am    Post subject: Problem running JMSAdmin.bat? Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 50

Hi,
Just installed WebSphere MQ V5.3 on Win XP SP2 machine. The postcard.bat application from command line is running fine. But when I run JMSAdmin.bat it gives the following error:

JNDI initialisation failed, please check your JNDI settings and service

Classpath:
Code:

D:\IBM\WebSphere MQ\Java\bin>set classpath
CLASSPATH=D:\IBM\WebSphere MQ\Java\lib\providerutil.jar;D:\IBM\WebSphere MQ\Java
\lib\com.ibm.mqjms.jar;D:\IBM\WebSphere MQ\Java\lib\ldap.jar;D:\IBM\WebSphere MQ
\Java\lib\jta.jar;D:\IBM\WebSphere MQ\Java\lib\jndi.jar;D:\IBM\WebSphere MQ\Java
\lib\jms.jar;D:\IBM\WebSphere MQ\Java\lib\connector.jar;D:\IBM\WebSphere MQ\Java
\lib\fscontext.jar;D:\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;.;D:\IBM\SQLLIB\j
ava\db2java.zip;D:\IBM\SQLLIB\java\db2jcc.jar;D:\IBM\SQLLIB\java\sqlj.zip;D:\IBM
\SQLLIB\java\db2jcc_license_cisuz.jar;D:\IBM\SQLLIB\java\db2jcc_license_cu.jar;D
:\IBM\SQLLIB\bin;D:\IBM\SQLLIB\java\common.jar


JMSAdmin.bat:
Code:
cls
java -DMQJMS_LOG_DIR="%MQ_JAVA_DATA_PATH%"\log -DMQJMS_TRACE_DIR="%MQ_JAVA_DATA_PATH%"\errors -DMQJMS_INSTALL_PATH="%MQ_JAVA_INSTALL_PATH%" com.ibm.mq.jms.admin.JMSAdmin %1 %2 %3 %4 %5


JMSAdmin.config:
Code:
INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
PROVIDER_URL=ldap://polaris/o=ibm,c=us
SECURITY_AUTHENTICATION=none


I do have WAS V 5.1.1.1 installed, but not using it and not running as well.

Somebody, please help me in fixing the above error.

Thanks in advance.

Bye,
Viki.
Back to top
View user's profile Send private message
BenR
PostPosted: Tue Feb 07, 2006 8:27 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2006
Posts: 60
Location: Hursley, UK

Are you using JMSAdmin.config exactly as quoted? e.g. PROVIDER_URL=ldap://polaris/o=ibm,c=us

If not, check the ICF and URL are correct for the namespace you're using.
Back to top
View user's profile Send private message Visit poster's website
viki
PostPosted: Tue Feb 07, 2006 8:33 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 50

Hi,
Yes, I'm using JMSAdmin.config exactly as quoted.

Bye,
Viki.
Back to top
View user's profile Send private message
BenR
PostPosted: Tue Feb 07, 2006 8:58 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2006
Posts: 60
Location: Hursley, UK

Then it's probably trying - and failing - to connect to a LDAP namespace called Polaris.

If you must use JNDI, the easiest way is to use the filesystem context - ICF is, I think, com.sun.jndi.fscontext.RefFSContextFactory and the URL is where you want the file to be, e.g. C:\temp\WMQ. Look at Chapter 5 for details of how to use the JMS Admin tool to create a ConnectionFactory definition.

However, for your purposes it's probably easier to forget about JNDI altogether and create the ConnectionFactory at runtime - have a look at Chapter 9, creating factories at runtime for details of what to do
Back to top
View user's profile Send private message Visit poster's website
viki
PostPosted: Tue Feb 07, 2006 9:31 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 50

Hi,

Well, I'm not sure of it, whether to drop JNDI thingy or not? But I'm trying to make connection from a standalone Java program to MQ Series.

I've seen chap 9, but it simple document all the WebSphere MQ classes for Java classes and interfaces.

Is there any sample code available which create ConnectionFactory at runtime?

Thanks,

Bye,
Viki.
Back to top
View user's profile Send private message
BenR
PostPosted: Tue Feb 07, 2006 9:55 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2006
Posts: 60
Location: Hursley, UK

I think I might have meant Chapter 10, not 9 - don't have a copy of Using Java to hand

If you keep JNDI, you have more admin but your application is provider-independent. If you create the ConnectionFactory at runtime, then you're tied to MQ (although fixing that is not particularly hard). Your choice.

To create the CF, try

MQConnectionFactory factory = new MQConnectionFactory();

factory.setQueueManager(QM_NAME);
factory.setHostName(HOST_NAME);
factory.setPort(PORT);
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setChannel("SYSTEM.DEF.SVRCONN");

Connection conn = factory.createConnection();

//etc.

Obviously there are some imports involved - javax.jms.* com.ibm.mq.jms.*
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Feb 07, 2006 10:09 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

BenR wrote:
I think I might have meant Chapter 10, not 9 - don't have a copy of Using Java to hand

The Info Center is only a click or two away...

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/jms77w1.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
viki
PostPosted: Tue Feb 07, 2006 10:12 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 50

Hi,

It's just like one has used Class.forName() in JDBC and then he/she replaced it from JNDI ResourceBundle.getBundle(). This is simple, if one knows.

Let me try the code you mentioned and will let you know.

Thanks.

Bye,
Viki.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem running JMSAdmin.bat?
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.