I am getting the following error while running the ldapimport.groovy script:
…
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘net.datenwerke.security.service.usermanager.entities.OrganisationalUnit@7470’ with class ‘net.datenwerke.security.service.usermanager.entities.AbstractUserManagerNode_$$_javassist_1’ to class ‘net.datenwerke.security.service.usermanager.entities.OrganisationalUnit’
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:360)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:599)
at ldap.LdapUserLoader.createOUNode(Script19.groovy:367)
at ldap.LdapUserLoader.this$2$createOUNode(Script19.groovy)
at ldap.LdapUserLoader$this$2$createOUNode.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
at ldap.LdapUserLoader.loadFromDirectory(Script19.groovy:294)
On 2.2.1 this worked OK.
The offending line is the following:
OrganisationalUnit node = (OrganisationalUnit) guidMap.get(getGuid(sr));
Casting it to AbstractUserManagerNode works, but then it’s impossible to add an object of type AbstractUserManagerNode to the OrganizationalUnit class [ parent.addChild(node) ]