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
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://" ) ; 
        InitialContext cosContext = new InitialContext(cosNamingEnv) ; 

The code responsible for setting the default values for the naming service in this instance can be found at : 

The exception is silently caught and we resort to default params (localhost:900)
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 ?

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.

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