Topic
  • No replies
vijisan
vijisan
2 Posts

Pinned topic JNDI InitialContext Lookup failure in WAS6.0

‏2010-08-12T02:23:52Z |
I created a EAR project and an application Client project using RAD 7.5. Client project has been included as a module in EAR. The client project has Main.java (Standalone class).

RAD7.5 has been configured to use local WAS6.0 test environment. JMS resources have been configured in WAS6.0 test environment and SI bus has already been created in WAS. My final goal is to send a message to SI bus queue using Main.java class. But I am getting the below exception during InitialContext lookup itself.
Exception in RAD7.5 console is below:
======================================
InitialContext starts....
Aug 11, 2010 10:07:46 PM com.ibm.ws.naming.util.CommonHelpers
WARNING: jndiproviderProperties
Aug 11, 2010 10:07:47 PM com.ibm.ws.naming.util.CommonHelpers
WARNING: jndiproviderProperties
Aug 11, 2010 10:07:47 PM com.ibm.websphere.naming.WsnInitialContextFactory
WARNING: noInitCtxFactoryImpl
Exception in thread "main" javax.naming.ConfigurationException: The property com.ibm.ws.naming.wsn.factory.initial is not set. The most likely cause is that the jar which contains the file com/ibm/websphere/naming/jndiprovider.properties cannot be found by the class loader.
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:194)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:112)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:675)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:257)
at javax.naming.InitialContext.init(InitialContext.java:233)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at sender.Main.main(Main.java:29)

Main.java class snippet is below:


24 public static void main(String[] args) throws Exception {

25 Hashtable env = new Hashtable();
26 env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
27 env.put(Context.PROVIDER_URL, "iiop://localhost:21005");
28 System.out.println("InitialContext starts....");
29 InitialContext initCtx = new InitialContext(env);

I see, Provider URL value as "iiop://localhost:21005/" in Universal Test Client GUI in RAD. RAD uses the default jdk which comes in RAD v7.5. Please help to troubleshoot what is causing this error?. I googled it, but couldn't find the cause. Thanks