NamingException and MalformedURLException Errors While Parsing Strings After Updating JDK

Solution Unverified - Updated -

Issue

Following a recent update of our OpenJDK (from java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64 to java-1.8.0-openjdk-1.8.0.332.b09-1.el8_5 .x86_64), we are facing an LDAP connection error causing the following stacktrace :

javax.naming.NamingException: Cannot parse url: ldap://ldap_test.alias:27613 [Root exception is java.net.MalformedURLException: unsupported authority: ldap_test.alias:27613]
at com.sun.jndi.ldap.LdapURL.<init>(LdapURL.java:115)
at com.sun.jndi.ldap.DefaultLdapDnsProvider.lookupEndpoints(DefaultLdapDnsProvider.java:48)
at com.sun.jndi.ldap.LdapDnsProviderService.lookupEndpoints(LdapDnsProviderService.java:108)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:166)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:695)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
at ldap.LdapAccessor.openUserDNConnection(LdapAccessor.java:152)

We encountered the exact same error case for a completely different application running in an OpenJDK 11 JVM that has also recently been updated (from java-11-openjdk-1:11.0.14.1.1-2.el8_5.x86_64 to java-11-openjdk-1:11.0.15.0.9-2.el8_5.x86_64), with a similar stacktrace:

javax.naming.NamingException: Cannot parse url: ldap://ldap_prod.alias:27808
at com.sun.jndi.ldap.LdapURL.<init>(LdapURL.java:115) ~[?:?]
at com.sun.jndi.ldap.DefaultLdapDnsProvider.lookupEndpoints(DefaultLdapDnsProvider.java:47) ~[?:?]
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:200) ~[?:?]
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:284) ~[?:?]
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:185) ~[?:?]
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:115) ~[?:?]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ~[?:?]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ~[?:?]
at javax.naming.InitialContext.init(InitialContext.java:236) ~[?:?]
at javax.naming.InitialContext.<init>(InitialContext.java:208) ~[?:?]
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) ~[?:?]

Environment

  • Red Hat OpenJDK
    • 1.8.332
    • 11.0.15.0.9-2
    • 17.0.3.0.7-2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content