JDK-8075196 : CosNaming's implementation doesn't comply with the specification
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 8u20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-03-15
  • Updated: 2018-02-08
  • Resolved: 2017-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 8
11Resolved 8u131Fixed
Description
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)
Comments
I'm moving this to the docs sections. Can I ask docs team to make the 2 edits to the jndi-cos.html file as per previous comment ?
28-07-2015

Submitter has requested us to clarify the document as follows. In the section ORB Initialization, http://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-cos.html#ORB add the following statement --- When the NS properties do not reference a running name service then the default which is the TNS is accessed. --- In the section Root Naming Context Initialization, http://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-cos.html#ROOT Modify the original description from If the java.naming.provider.url has not been set, then the root naming context is obtained by invoking the following method on the ORB to --- If the java.naming.provider.url has not been set, or has been incorrectly set, such that it doesn't reference a root naming context, then the root naming context is obtained by invoking the following method on the ORB. --- These edits look fine to me. I'm awaiting approval from Dev enigneer before getting the docs updated.
05-06-2015

Requesting more info from submitter on whether they want docs to be edited or whether an implementation change is being sought.
02-04-2015