Skip to content

8296183: jndiprovider.properties contains properties pointing to non-existing classes#29712

Open
jaikiran wants to merge 3 commits intoopenjdk:masterfrom
jaikiran:8296183
Open

8296183: jndiprovider.properties contains properties pointing to non-existing classes#29712
jaikiran wants to merge 3 commits intoopenjdk:masterfrom
jaikiran:8296183

Conversation

@jaikiran
Copy link
Member

@jaikiran jaikiran commented Feb 13, 2026

Can I please get a review of this change which removes the unused src/java.naming/share/classes/com/sun/jndi/ldap/jndiprovider.properties file? This addresses the issue noted in https://bugs.openjdk.org/browse/JDK-8296183.

This jndiprovider.properties file lists 3 properties java.naming.factory.control, java.naming.factory.object and java.naming.factory.state. The semantics of these environment properties are explained in https://docs.oracle.com/javase/jndi/tutorial/beyond/env/provider.html. The classes configured in com/sun/jndi/ldap/jndiprovider.properties for each of these properties are non-existent in the JDK. Looking at the version control history of the JDK, these classes haven't been around for several releases (not even in JDK 8). The jndiprovier.properties gets looked up by an JDK internal class in the java.naming module - com.sun.naming.internal.ResourceManager. The ResourceManager.getFactories(...) method is the one that gets called to load the classes configured for those 3 environment properties. The javadoc of ResourceManager.getFactories(...) says this:

Retrieves an enumeration of factory classes/object specified by a property.

The property is gotten from the environment and the provider resource file associated with the given context and concatenated.
... The resulting property value is a list of class names.
This method then loads each class using the current thread's context class loader and keeps them in a list.
Any class that cannot be loaded is ignored.
...

The implementation of ResourceManager.getFactories(...) matches that javadoc. Because the implementation ignores such missing classes, the reference to these non-existent classes in the com/sun/jndi/ldap/jndiprovider.properties has gone unnoticed all this while. Manual experiments of exercising this code path does indeed show that a ClassNotFoundException gets raised (and ignored) for the classes referenced in that jnidprovider.properties file.

The commit in this PR removes the jndiprovier.properties. It also removes a javadoc reference to one of these non-existent classes. Given the nature of the change no new tests have been introduced and the existing tests in tier1, tier2 and tier3 continue to pass.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8296183: jndiprovider.properties contains properties pointing to non-existing classes (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29712/head:pull/29712
$ git checkout pull/29712

Update a local copy of the PR:
$ git checkout pull/29712
$ git pull https://git.openjdk.org/jdk.git pull/29712/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29712

View PR using the GUI difftool:
$ git pr show -t 29712

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29712.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 2026

👋 Welcome back jpai! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 13, 2026

@jaikiran This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8296183: jndiprovider.properties contains properties pointing to non-existing classes

Reviewed-by: dfuchs, aefimov

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 2 new commits pushed to the master branch:

  • 486ff5d: 8377455: Replace LinkedList with GrowableArray in VM.ThreadDump's OMTable
  • 4e7106d: 8377035: [s390x] Disable JSR166 test cases which uses virtual threads

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Feb 13, 2026
@openjdk
Copy link

openjdk bot commented Feb 13, 2026

@jaikiran The following labels will be automatically applied to this pull request:

  • build
  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 13, 2026
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2026

Webrevs

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me. Good to avoid those unneeded CNFE. If backported, some more checks might be required on JDK 8 - as CORBA is still supported there.

* @see PersistentSearchControl
* @see com.sun.jndi.ldap.ctl.ResponseControlFactory ResponseControlFactory
* @author Vincent Ryan
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it matters much, but I see that DefaultResponseControlFactory and PersistentSearchControl both have an @see EntryChangeResponseControl so I'd suggest to replace:

-  * @see com.sun.jndi.ldap.ctl.ResponseControlFactory ResponseControlFactory
+  * @see DefaultResponseControlFactory

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I've updated the PR accordingly.

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to get @AlekseiEfimov approval before integrating.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 13, 2026
Copy link
Member

@AlekseiEfimov AlekseiEfimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@AnirvanSarkar
Copy link
Member

Looking at the version control history of the JDK, these classes haven't been around for several releases (not even in JDK 8)

It seems these classes were never part of the JDK.
These classes were part of the (legacy?) JNDI/LDAP booster pack ldapbp.jar available as a separate download.
The download file is currently ldap-1_2_4.zip in the Oracle Java Archive for Java Platform Technologies [1].

Software vendors required ldapbp.jar to be added to the CLASSPATH.
The very old JNDI tutorial also references ldapbp.jar [2].

Booster pack has the following packages:

Package Contents
com.sun.jndi.ldap.obj RMI, CORBA support for LDAP Service Provider for JNDI
com.sun.security.sasl.misc CRAM-MD5, Anonymous, and Plain SASL Drivers
com.sun.jndi.ldap.ctl Controls for LDAP Service Provider for JNDI

The packages com.sun.security.sasl.misc and com.sun.jndi.ldap.ctl became obsolete when its support was included in the JDK 5.

I suspect the classes of package com.sun.jndi.ldap.obj were not included in JDK, as RFC 2713 & RFC 2714 were not standardized unlike other RFCs related to LDAP.

The booster pack is also available on Maven repository [3].
Do you think any of its dependencies could be impacted by removal of jndiprovider.properties file?
Should this removal be mentioned in the release notes?

If you want to look at the booster pack’s source code, it’s included in GlassFish 5 [4].

[1] : https://www.oracle.com/java/technologies/java-archive-downloads-java-plat-downloads.html#7110-jndi-1.2.1-oth-JPR
[2] : https://docs.oracle.com/javase/jndi/tutorial/objects/storing/index.html
[3] : https://mvnrepository.com/artifact/com.sun/ldapbp
[4] : https://github.com/javaee/glassfish/tree/master/appserver/ldapbp/src/main/java/com/sun/jndi/ldap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants