Submitter is asking if the com.sun.jndi.cosnaming.CNCtx implementation is adhering to the JNDI documentation outlined at http://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-cos.html#ROOT
As per testcase one can see that the CNCtx code falls back to a default "localhost:900" set up if an issue is encountered whilst parsing/connecting to the IIOP URL outlined by the java.naming.provider.url system property.
testcase :
*****
import javax.naming.*;
import java.util.*;
public class Test {
public static void main(String[] args) throws Exception {
Hashtable cosNamingEnv = new Hashtable() ;
cosNamingEnv.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory" ) ;
cosNamingEnv.put("java.naming.provider.url","iiop://1.2.3.4:12345" ) ;
InitialContext cosContext = new InitialContext(cosNamingEnv) ;
}
}
*****
The code responsible for setting the default values for the naming service in this instance can be found at :
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java#l316
The exception is silently caught and we resort to default params (localhost:900)