Exception: Need to specify class name in environment or system property: java.naming.factory.initial
        Posted  
        
            by 
                DanDan
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by DanDan
        
        
        
        Published on 2010-01-04T08:14:49Z
        Indexed on 
            2012/10/28
            5:02 UTC
        
        
        Read the original article
        Hit count: 262
        
jms
When i run a JMS related application, i am encountering the following exception error.
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
We are using Sun Application Server 9.1
Any idea what are we missing?
I already tried adding the following but result still the same
    Properties env = new Properties();
    env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    Context ctx = new InitialContext(env);
© Stack Overflow or respective owner