Author |
Message
|
viki |
Posted: Tue Feb 07, 2006 8:19 am Post subject: Problem running JMSAdmin.bat? |
|
|
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 |
|
 |
BenR |
Posted: Tue Feb 07, 2006 8:27 am Post subject: |
|
|
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 |
|
 |
viki |
Posted: Tue Feb 07, 2006 8:33 am Post subject: |
|
|
Acolyte
Joined: 07 Feb 2006 Posts: 50
|
Hi,
Yes, I'm using JMSAdmin.config exactly as quoted.
Bye,
Viki. |
|
Back to top |
|
 |
BenR |
Posted: Tue Feb 07, 2006 8:58 am Post subject: |
|
|
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 |
|
 |
viki |
Posted: Tue Feb 07, 2006 9:31 am Post subject: |
|
|
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 |
|
 |
BenR |
Posted: Tue Feb 07, 2006 9:55 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Feb 07, 2006 10:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
viki |
Posted: Tue Feb 07, 2006 10:12 am Post subject: |
|
|
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 |
|
 |
|