I am getting exception while running a stand alone program:
Properties env = new Properties();
env.setProperty(Context.PROVIDER_URL, "iiop://localhost:900");
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");

InitialContext initCtx = new InitialContext();

System.out.println("Getting connection factory....");
// Finding the WAS QueueConnectionFactory
javax.jms.ConnectionFactory qcf = (javax.jms.ConnectionFactory) initCtx.lookup(JMSCF_JNDI_NAME);
System.out.println("qcf="+qcf);




javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
at com.ibm.ws.naming.java.javaURLContextFactory.isNameSpaceAccessable(javaURLContextFactory.j ava:98)
at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance(UrlContextFactory.java:73)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:579)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:528)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:275)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.txlifeadapter.jms.MessageSender.<init>(MessageSender.java:47)
at com.txlifeadapter.jms.MessageClient.init(MessageClient.java:25)
at com.txlifeadapter.jms.MessageClient.main(MessageClient.java:53)
init2