So I’ve recently updated to the latest docker container Nexus OSS 3.20.0
Now I’m facing an error when trying to create a new LdapConfiguration
When running def ldapConfig = new LdapConfiguration()
I get the error You cannot create an instance from the abstract interface 'org.sonatype.nexus.ldap.persist.entity.LdapConfiguration'.\n @ line 12, column 1.\n new LdapConfiguration()
I tried downgrading and it works
Did something change for this from 3.19.1 -> 3.20.0
There was a change to that class, as you surmise. It was changed from a concrete class to an interface. Can you post your script on this thread so we can help you update it? You can also PM it to me if you are more comfortable with that option.
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.
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.
Nexus Repository Manager 3 now has a beta REST API. Groovy scripting has always been potentially dangerous since we may change our internal classes at any time. Ideally, where possible, it’s best to use our REST APIs since they won’t change once we release them as v1 and they are the supported way to configure Nexus Repository Manager. At a quick glance I don’t think that script is doing anything the REST API doesn’t support which would let you use whatever tooling you are comfortable with instead of some groovy script you know nothing about.