Tomcat 8 - LDAP: NameNotFoundException error code 32, remaining name empty string

前端 未结 1 1935
时光取名叫无心
时光取名叫无心 2020-12-11 01:10

Trying to migrate an application from WebLogic 12.2.1 to Tomcat 8.5.4, what under Weblogic was an entry as Foreign JNDI Providers

相关标签:
1条回答
  • 2020-12-11 01:29

    The stacktrace went away by appending to the java.naming.provider.url property the LDAP schema DN, using the first factory implementation provided in the question.

    Below a screenshot of the LDAP client used in this context, the Apache Directory Studio / LDAP Browser embedded in Eclipse, from which it was possible to browse the concerned LDAP simply using the initial values of the question.

    By appending the schema DN of the Root element to the connection URL, the exception went away and the LDAP resource is now shared via JNDI in Tomcat 8.


    Further details as outcome of the troubleshooting:

    In Tomcat 8 global resources are handled via a global resource listener, the GlobalResourcesLifecycleListener, defined by default in the server.xml file. Such a listener invokes a context.listBindings("") on bean creation, hence effectively browsing the LDAP directory.

    This initial browsing may most probably be the difference between Tomcat and WebLogic, where LDAP is looked up via JNDI only when required, hence via direct query, rather than at start-up with a generic query. As such, in Tomcat the LDAP url would need further details, that is, a slightly different configuration as part of its url to directly point to a valid base DN.

    From official WebLogic documentation:

    On start up, WebLogic Server attempts to connect to the JNDI source. If the connection is successful, WebLogic Server sets up the requested objects and links in the local JNDI tree, making them available to WebLogic Server clients.

    Hence, a connection is rather simpler than a listBindings:

    Enumerates the names bound in the named context, along with the objects bound to them. The contents of any subcontexts are not included.

    0 讨论(0)
提交回复
热议问题