|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JNDI initialisation failed |
« View previous topic :: View next topic » |
Author |
Message
|
Ahmedmonseif |
Posted: Thu Jun 13, 2002 5:37 am Post subject: JNDI initialisation failed |
|
|
Novice
Joined: 30 Apr 2002 Posts: 12
|
Hi all,
I use 2000server i want to configure VisualAge to run jms with mqseries
i modefiy JMSAdmin config file:
INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
PROVIDER_URL=iiop://ahmed:900
and import all package required ,edit the classpath,edit resources of
VisualAge
then i start Persistance name server,
when i try to run JMSAdmin inside VisualAge
("JNDI initialisation failed, please check your JNDI settings and service")
any steps more?
any one can help me or any url can give me more details about this subject
thanks . |
|
Back to top |
|
 |
fajarhto |
Posted: Thu Jun 20, 2002 8:00 pm Post subject: |
|
|
Newbie
Joined: 28 Jun 2001 Posts: 3 Location: Indonesia
|
Hi Ahmed,
Please follow this guide, I got from IBM Workshop.
It might be useful for start JMS using VAJ
Assume C:\MQSeries is your MQ Installation root path
1. Add MQ JMS Classes
a. Create a new project called MQ JMS
b. Select the MQ JMS project and import the following class libraries (jar files)
from the C:\MQSeries\Java\lib directory:
com.ibm.mq.jar
com.ibm.mqjms.jar
2. Add MQ JMS Resources
In addition to the MQ JMS classes, there are some additional files that are required
by MQ JMS which need to be imported into VisualAge Java. The first - mqji.properties -
is a properties file containing warning and error messages used by MQ JMS.
The second - JMSAdmin.config - is a configuration file used the MQ JMS Administration
tool and contains the relevant settings for connecting to a namespace.
a. Open the MQ JMS project in a project browser. Switch to the Resource tab and add the
following resources:
C:\MQSeries\Java\lib\mqji.properties
C:\MQSeries\Java\bin\JMSAdmin.config
3. Run the Installation Verification Test (IVT)
Here we will run the Installation Verification Test (IVT) application again to verify our
install. Only this time we are running it inside VisualAge Java.
a. Open the MQ JMS project in a project browser. Select the com.ibm.mq.jms package then
the MQJMSIVT class within that package. Right click and select Run->Check Classpath.
In the properties dialogue, click the Compute Now button to generate the classpath. The
classpath should now include the following projects:
IBM Enterprise Extension Libraries
IBM WebSphere Test Environment
Before closing the dialogue, switch to the Program tab and add the following command line
argument -nojndi so we can run it without requiring a jndi namespace to be configured.
Run the MQJMISVT.
4. Configure JMS Admin using the WebSphere Test Environment
In the previous step we ran the IVT script in non-jndi mode. Typically, however, JMS applications
will use administered objects retrieved from a namespace. the MQ JMS Administration tool - JMSAdmin -
is the tool that allows us to bind JMS objects to a jndi namespace.
As was the case when configuring the JMSAdmin tool to use the WebSphere namespace, we will need to
configure the JMSAdmin tool to use the WebSphere Test Environment (WTE) namespace. Again, the two
key values that we need to set are the INITIAL_CONTEXT_FACTORY and the PROVIDER_URL. These properties
are held in the JMSAdmin.config file which we will now modify.
a. pen the JMSAdmin.config file using Notepad as the text editor. This file is located in the
C:\IBMVJAVA\ide\project_resources\MQ JMS directory
b. Remove the comments from the following lines:
INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
PROVIDER_URL=iiop://localhost/
c. We need to add the relevant classes required by JMSAdmin to its classpath. In the MQ JMS project,
select the JMSAdmin class within the com.ibm.mq.jms.admin package. Right click and select
Run->Check Classpath. In the properties dialogue, click the Compute Now button to generate the
classpath.
d. We now want to verify that the JMSAdmin tool is configured correctly. If running, stop the
WebSphere adminserver. Start the WebSphere Test Environment (WTE) using:
Workspace ->Tools->WebSphere Test Environment
e. In the WTE window, start the Persistent Name Server (PNS)
f. Once the PNS has completed startup (i.e. 'Server open for e-business' output in Console),
start the JMSAdmin tool. To do this, run the JMSAdmin class located in the MQ JMS project within
the com.ibm.mq.jms.admin package. You should see the prompt InitCtx> in the output area of the Console
Note: If you receive the error message: JNDI initialization failed, check that the PNS is running and
that WTE is on the JMSAdmin classpath. In addition, take a look at the JMSAdmin.config file to see
that the correct properties have been set.
g. Leave the JMSAdmin application running as we will be defining some JMS Administered objects in
the next step.
5. Define the JMS Administered Objects for use by the Installation Verification Test (IVT)
The IVT application when used in jndi mode make use of a number of administered JMS objects -
a QueueConnectionFactory and a Queue - which we will need to define here.
a. Firstly we will add a JMS QueueConnectionFactory object. As shown below, in the Standard In area
of the Console enter:
DEFINE QCF(ivtQCF)
b. Now we need to add a JMS Queue object to the namespace. As shown below, in the Standard In area
of the Console enter:
DEFINE Q(ivtQ) QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE)
c. Lets browse the context to see our newly created JMS objects. In the Standard In area of the
Console enter:
DISPLAY CTX
You should now see the following output. Note: look for the JMS objects ivtQ and ivtQCF
d. Now that we've created our JMS objects in the namespace we can stop the JMS Admin application.
In the Standard In area of the Console enter:
END
6. Run the Installation Verification Test (IVT) with WebSphere Test Environment
Previously we ran the Installation Verification Test (IVT) application without using a jndi namespace.
We now want to run the IVT again but this time using a jndi namespace, which in VisualAge Java is the
WebSphere Test Environment (WTE). This will require using the JMSAdmin tool to bind the relevant JMS
objects in the WTE namespace.
a. Now run the IVT application but this time using jndi. Select the MQ JMS project and navigate to
the MQJMSIVT class in the com.ibm.mq.jms package. Right click and select Run->Run Main with the
following command line arguments:
-url iiop://localhost:900 -icf com.ibm.ejs.ns.jndi.CNInitialContextFactory |
|
Back to top |
|
 |
vgawli |
Posted: Mon Jun 18, 2007 10:11 pm Post subject: |
|
|
Newbie
Joined: 18 Jun 2007 Posts: 6
|
Hi,
I'm quite new to JMS and MQ, I just installed WebSphereMQ5.3.0.2 on a windows XP machine.
While installing MQ, I installed JMS messaging service option and want to create topics and stuff using JMS.
I found out that to do that, I need to use JMSADMIN tool for this, but when I try to run that tool, I'm getting this message:
JNDI initialisation failed, please check your JNDI settings and service
The INITIAL_CONTEXT and PROVIDER_URL in the JMSADMIN.config file has the following values:
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
and
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
#PROVIDER_URL=file:/C:/JNDI-Directory
#PROVIDER_URL=iiop://localhost/
which one of them should I enable to get the JMSADMIN tool working?
Thanks
Vinay Gawli |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 19, 2007 2:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to uncomment the initial Context factory you are using and its proper provider url.
As a beginning might I suggest using the sun file based JNDI as it is the easiest to use in stand alone. Once you understand how it works you'll be ready to move on to a more complex JNDI environment.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
vgawli |
Posted: Tue Jun 19, 2007 4:31 am Post subject: |
|
|
Newbie
Joined: 18 Jun 2007 Posts: 6
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|