|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[SOLVED]Problem with JNDI Locator |
« View previous topic :: View next topic » |
Author |
Message
|
jmac |
Posted: Mon Nov 22, 2004 9:52 am Post subject: [SOLVED]Problem with JNDI Locator |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I am trying to use the JNDI locator and getting the following error:
Code: |
java.lang.NullPointerException
at com.ibm.workflow.api.iiop.DomainControllerImpl$Reaper.access$0(DomainControllerImpl.java:86)
at com.ibm.workflow.api.iiop.DomainControllerImpl.locate(DomainControllerImpl.java:117)
at com.ibm.workflow.api.Agent$JndiLocator.locate(Agent.java:107)
at com.ibm.workflow.api.Agent.locate(Agent.java:198)
at com.syscom.apitraining.All_JAVA_API.<init>(All_JAVA_API.java:90)
at com.syscom.apitraining.All_JAVA_API.main(All_JAVA_API.java:435)
|
I have set up everything as per the Appendix I in the Install guide, and my nameserver and agent are running.
The code I am using is
Code: |
if ( locType.equalsIgnoreCase("JNDI") )
{
myAgent.setLocator(Agent.JNDI_LOCATOR);
Properties props = new Properties();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
props.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:900");
myAgent.setContext(new String [0], props);
}
else
myAgent.setLocator(Agent.LOC_LOCATOR);
myAgent.setName("MQWFAGENT");
service=
myAgent.locate(systemGroup,
system);
|
The error is on the myAgent.locate, and the systemGroup and system parameters are set to zero length strings (i.e "").
Most likely I am missing something silly, but I can not figure it out.
Any help will be greatly appreciated. _________________ John McDonald
RETIRED
Last edited by jmac on Wed Dec 01, 2004 5:05 am; edited 1 time in total |
|
Back to top |
|
 |
manoj |
Posted: Tue Nov 23, 2004 11:40 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
What's youe JNDI Server _________________ -manoj |
|
Back to top |
|
 |
vennela |
Posted: Tue Nov 23, 2004 12:45 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
What's youe JNDI Server |
Based on the port number:
Code: |
props.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:900"); |
I would guess it is WAS |
|
Back to top |
|
 |
jmac |
Posted: Tue Nov 23, 2004 2:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Nameserver: C:\J2SDK1~1.0_0\bin>tnameserv
Code: |
Initial Naming Context:
IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000000000010000000000000080000102000000000e3139322e3136382e312e31303100038400000035afabcb000000002062b573440000000100000000000000010000000d544e616d65536572766963650000000000000004000000000a0000000000000100000001000000200000000000010001000000020501000100010020000101090000000100010100
TransientNameServer: setting port for initial object references to: 900
Ready.
|
I have JDK
Code: |
C:\>java -version
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
|
This error is occurring anytime I try to run using JNDI, including using the HelloApplication in the sample directory.
I am sure I am just doing something silly, but I just don't see it.
THANKS[/code] _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
manoj |
Posted: Tue Nov 30, 2004 11:09 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
John,
If you can the Dump the namespace and if you see an Entry "MQWFAGENT" (Agent name) in there then it should be working..
Now for tnameserv i donno what's the command to dump the namespace..but for Websphere it's "Dumpnamespace".
So if you check the tnameserv doc you might get something similar to this. _________________ -manoj |
|
Back to top |
|
 |
jmac |
Posted: Wed Dec 01, 2004 5:04 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I found that the agent was running with the IBM JDK, and my java code was running with the SUN JDK. Once I set the agent to the Sun JDK everything worked fine. _________________ John McDonald
RETIRED |
|
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
|
|
|
|