#1 2015-02-11 05:41:52

dennisliu
Member
Registered: 2015-01-16

LDAP Import Error in RS 2.2.1-5602

Hi,

I am trying to import users from LDAP using script ldapimport.groovy with the settings below:

lul.setProviderUrl("ldap://ad01.globalunichip.com:389");
lul.setSecurityPrincipal("CN=adlookup03,CN=Users,DC=global,DC=com");
lul.setSecurityCredentials("password");
lul.setLdapBase("OU=User in Hsinchu,DC=global,DC=com");

but when execute the script it shows me below error, have any suggestion?
Thank you~

Dennis

========================================================================
net.datenwerke.rs.scripting.service.scripting.exceptions.ScriptEngineException: javax.script.ScriptException: javax.script.ScriptException: net.datenwerke.treedb.service.treedb.exceptions.UnsupportedChildException: Tried to add an object of type OrganisationalUnit to User. This is not possible.
at net.datenwerke.rs.scripting.service.scripting.engines.GroovyEngine.eval(GroovyEngine.java:67)
at net.datenwerke.rs.scripting.service.scripting.ScriptingServiceImpl.executeScript(ScriptingServiceImpl.java:205)
at net.datenwerke.rs.scripting.service.scripting.ScriptingServiceImpl.executeScript(ScriptingServiceImpl.java:251)
at net.datenwerke.rs.scripting.service.scripting.ScriptingServiceImpl.executeScript(ScriptingServiceImpl.java:299)
at net.datenwerke.rs.scripting.service.scripting.ScriptingServiceImpl.executeScript(ScriptingServiceImpl.java:270)
at net.datenwerke.rs.scripting.service.scripting.terminal.commands.ExecScriptCommand.doTransactionExecute(ExecScriptCommand.java:320)
at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66)
at net.datenwerke.rs.scripting.service.scripting.terminal.commands.ExecScriptCommand$1$1.doFilter(ExecScriptCommand.java:244)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at net.datenwerke.rs.scripting.service.scripting.terminal.commands.ExecScriptCommand$1.call(ExecScriptCommand.java:238)
at net.datenwerke.rs.scripting.service.scripting.terminal.commands.ExecScriptCommand$1.call(ExecScriptCommand.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.script.ScriptException: javax.script.ScriptException: net.datenwerke.treedb.service.treedb.exceptions.UnsupportedChildException: Tried to add an object of type OrganisationalUnit to User. This is not possible.
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:138)
at net.datenwerke.rs.scripting.service.scripting.engines.GroovyEngine.eval(GroovyEngine.java:65)
... 16 more
Caused by: javax.script.ScriptException: net.datenwerke.treedb.service.treedb.exceptions.UnsupportedChildException: Tried to add an object of type OrganisationalUnit to User. This is not possible.
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:335)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:132)
... 17 more
Caused by: net.datenwerke.treedb.service.treedb.exceptions.UnsupportedChildException: Tried to add an object of type OrganisationalUnit to User. This is not possible.
at net.datenwerke.treedb.service.treedb.AbstractNode.addChild(AbstractNode.java:316)
at net.datenwerke.treedb.service.treedb.AbstractNode.addChild(AbstractNode.java:292)
at net.datenwerke.treedb.service.treedb.AbstractNode$addChild.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at ldap.Script6.run(Script6.groovy:47)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:332)
... 18 more

Offline

#2 2015-02-11 11:46:50

Thorsten J. Krause
Guest

Re: LDAP Import Error in RS 2.2.1-5602

Hi Dennis,

looks as if your directory contains a user that has child elements. Let's get some more information on the relevant objects so we can decide if this is something you would like to fix in your directory or if we can easily work around it.

In the ldapimport script locate the line
   

umNode = createOUNode(sr, parent);

and replace it with this code:

try {
  umNode = createOUNode(sr, parent);
}catch(net.datenwerke.treedb.service.treedb.exceptions.UnsupportedChildException e){
  throw new RuntimeException("NODE=" + sr.toString() + ", PARENT=" + parent.toString, e);
}

if you run it again, the error message will include the offending node.

Cheers,
Thorsten

#3 2015-02-13 00:58:08

dennisliu
Member
Registered: 2015-01-16

Re: LDAP Import Error in RS 2.2.1-5602

Hi, Thorsten,

Thank you for reply, I will try it!

Regards,
Dennis

Offline

Board footer

Powered by FluxBB