Issue with LdapConfiguration

Hi. I am the maintainer of the above mentioned repository. For anyone who would pass by, this is the solution we found after trial and error on my side and help from my users.

The base problem was:

def ldapConfiguration = new LdapConfiguration()

which is now an interface and cannot be instanciated anymore as explained by @andres above.

First try to fix:

def ldapConfigMgr = container.lookup(LdapConfigurationManager.class.getName())
def ldapConfig = ldapConfigMgr.getConfiguration()

This was mostly working except that the following line:

ldapConfig.setName(parsed_args.name)

was firing an error

No signature of method: java.util.LinkedHashMap.setName() is applicable for argument types: (java.lang.String)

Second try (good one):

def ldapConfigMgr = container.lookup(LdapConfigurationManager.class.getName())
def ldapConfig = ldapConfigMgr.newConfiguration()
ldapConfig.setName(parsed_args.name)

Subsidiary questions to community

I maintain this script as part of an ansible role to automate deployment and provisionning of nexus. I inherited this role from the previous author at @savoir-faire-linux. It worked, I almost never touched it (some PR included new params that where missing…). I don’t even know where the original script comes from and how someone was able to craft it without any documentation or code. And I am not at all a groovy/java expert.

I understand that all ldap.* classes are internal and that I should expect them to change without prior notice. But is there any way we can get basic information of the available methods and their expected params ? Because this one was a (too) long bake.

Thanks in advance for your response.

1 Like