title: Exception: Need to specify class name in environment or system property: java.naming.factory.initial
body: <p>When i run a JMS related application, i am encountering the following exception error.</p>
  
  <p>javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial</p>
  
  <p>We are using Sun Application Server 9.1</p>
  
  <p>Any idea what are we missing?</p>
  
  <p>I already tried adding the following but result still the same</p>
  
  <pre><code>    Properties env = new Properties();
      env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
  
      Context ctx = new InitialContext(env);
  </code></pre>