#1 2015-04-15 13:18:15

asdasd
Member
Registered: 2015-02-26

RS 2.2.2 - LDAPImport problem

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) ]

Offline

#2 2015-04-15 15:14:02

Thorsten J. Krause
Guest

Re: RS 2.2.2 - LDAPImport problem

Hi,

can you try this updated version of the import script?
I can't test it myself right now, but that should take care of this issue.
Let me know, if it works, so I can update the blog post.

http://www2.datenwerke.net/files/forum/ … ort.groovy

Cheers,
Thorsten

#3 2015-04-15 16:16:58

asdasd
Member
Registered: 2015-02-26

Re: RS 2.2.2 - LDAPImport problem

Well, I don't see anything in that code that would actually call the run method of LdapRunner (or create an instance of it, for that matter), so can't test.

Last edited by asdasd (2015-04-15 16:20:39)

Offline

#4 2015-04-15 16:39:52

Thorsten J. Krause
Guest

Re: RS 2.2.2 - LDAPImport problem

Ups, sorry.

Add this Line before the LdapRunner Class Definition

GLOBALS.getInstance(LdapRunner.class).run(GLOBALS);

Or use the updated script: http://www2.datenwerke.net/files/forum/ … ort.groovy

#5 2015-04-16 06:49:14

asdasd
Member
Registered: 2015-02-26

Re: RS 2.2.2 - LDAPImport problem

works now, thank you.

Offline

Board footer

Powered by FluxBB