# RS 2.2.2 - LDAPImport problem

**URL:** <https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283>\
**Category:** ReportServer (EN)\
**Created:** [April 15, 2015, 1:18pm UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283 "2015-04-15T13:18:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asdasd](https://forum.reportserver.net/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@asdasd](https://forum.reportserver.net/u/asdasd)\
**Post date:** [April 15, 2015, 1:18pm UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283/1 "2015-04-15T13:18:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Guest](https://forum.reportserver.net/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@Guest](https://forum.reportserver.net/u/Guest)\
**Post date:** [April 15, 2015, 3:14pm UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283/2 "2015-04-15T15:14:02Z")

</div>

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/ldapimport.groovy](http://www2.datenwerke.net/files/forum/ldapimport.groovy)

Cheers,  
Thorsten

---

<div class="post-metadata">

**Author:** ![asdasd](https://forum.reportserver.net/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@asdasd](https://forum.reportserver.net/u/asdasd)\
**Post date:** [April 15, 2015, 4:16pm UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283/3 "2015-04-15T16:16:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Guest](https://forum.reportserver.net/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@Guest](https://forum.reportserver.net/u/Guest)\
**Post date:** [April 15, 2015, 4:39pm UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283/4 "2015-04-15T16:39:52Z")

</div>

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/ldapimport.groovy](http://www2.datenwerke.net/files/forum/ldapimport.groovy)

---

<div class="post-metadata">

**Author:** ![asdasd](https://forum.reportserver.net/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@asdasd](https://forum.reportserver.net/u/asdasd)\
**Post date:** [April 16, 2015, 6:49am UTC](https://forum.reportserver.net/t/rs-2-2-2-ldapimport-problem/283/5 "2015-04-16T06:49:14Z")

</div>

works now, thank you.
