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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » [SOLVED]Problem with JNDI Locator

Post new topic  Reply to topic
 [SOLVED]Problem with JNDI Locator « View previous topic :: View next topic » 
Author Message
jmac
PostPosted: Mon Nov 22, 2004 9:52 am    Post subject: [SOLVED]Problem with JNDI Locator Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
manoj
PostPosted: Tue Nov 23, 2004 11:40 am    Post subject: Reply with quote

Master

Joined: 30 Jan 2002
Posts: 237
Location: Virgina

What's youe JNDI Server
_________________
-manoj
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
vennela
PostPosted: Tue Nov 23, 2004 12:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jmac
PostPosted: Tue Nov 23, 2004 2:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
manoj
PostPosted: Tue Nov 30, 2004 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
jmac
PostPosted: Wed Dec 01, 2004 5:04 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » [SOLVED]Problem with JNDI Locator
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.