Hi Clément,
My java version is:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
And the JAVA_HOME directory is: JAVA_HOME=/usr/lib64/jvm/jre
I put the java array force at the end of the dataset script as follows:
<![CDATA[rjs:
var membersSrcDn = srcBean.getDatasetValuesById("member");
var membersDstDn = [];
for (var i=0; i<membersSrcDn.length; i++) {
var memberSrcDn = membersSrcDn.get(i);
var uid = "";
try {
uid = srcLdap.attribute(memberSrcDn, "uid").get(0);
} catch(e) {
continue;
}
var destDn = ldap.search("CN=Users",
"(sAMAccountName="+uid+")");
if (destDn.length == 0 || destDn.length > 1) {
continue;
}
var destMemberDn = destDn.get(0) + "," +
ldap.getContextDn();
membersDstDn.push(destMemberDn);
}
//membersDstDn
var resTab =
java.lang.reflect.Array.newInstance(java.lang.String,membersDstDn.length);
for (var i=0; i<membersDstDn.length; i++) {
resTab[i] = membersDstDn[i];
}
resTab
]]>
Do you have any idea why I get the following Error:
ERROR - Error while synchronizing ID {cn=[kw_lehre]}:
org.lsc.exception.LscServiceException: java.lang.RuntimeException:
java.lang.NoSuchMethodException: None of the fixed arity signatures
[(java.lang.Class, int), (java.lang.Class, int[])] or the variable arity
signatures [(java.lang.Class, int...)] of the method
java.lang.reflect.Array.newInstance match the argument types
[jdk.internal.dynalink.beans.StaticClass, java.lang.Long]
Thank you in advance for your help.
King regards,
Ali
Am 23.02.15 um 14:06 schrieb Ali Oezdemir:
Hi,
the force of the java Array don´t work, i get the following error:
ERROR - Error while synchronizing ID {cn=[kw_lehre]}:
org.lsc.exception.LscServiceException: java.lang.RuntimeException:
java.lang.NoSuchMethodException: None of the fixed arity signatures
[(java.lang.Class, int), (java.lang.Class, int[])] or the variable
arity signatures [(java.lang.Class, int...)] of the method
java.lang.reflect.Array.newInstance match the argument types
[jdk.internal.dynalink.beans.StaticClass, java.lang.Long]
King regards,
Ali
Am 23.02.15 um 11:29 schrieb Clément OUDOT:
2015-02-23 11:21 GMT+01:00 Ali Oezdemir <[email protected]>:
Hi Clément,
Thank you very much. I solved the problem. I can synchronize the
users in
OpenLDAP to AD.
Now I have another problem: I want to synchronize groups from my
OpenLDAP to
AD and get this Error:
ERROR - Error while modifying entry
CN=kw_lehre,OU=Groups,DC=abk-stuttgart,DC=domain in directory
:javax.naming.InvalidNameException: CN=kw_lehre,OU=Groups: [LDAP:
error code
34 - could not parse [object Array] as a
1.3.6.1.4.1.1466.115.121.1.12 DN];
remaining name 'CN=kw_lehre,OU=Groups'
I use the javascript as described in the documentation. The elements
are
configured correctly because individual elements of the Array can be
evaluated but not the complete Array. LSC couldn´t parse the
complete Array.
I tried it with different delimiter like '$' or ',' but it still
doesn´t
work, so we can exclude a delimiter problem.
I configured the javascript as follows:
<string>
<![CDATA[rjs:
var membersSrcDn = srcBean.getDatasetValuesById("member");
var membersDstDn = [];
for (var i=0; i<membersSrcDn.length; i++) {
var memberSrcDn = membersSrcDn.get(i);
var uid = "";
try {
uid = srcLdap.attribute(memberSrcDn,
"uid").get(0);
} catch(e) {
continue;
}
var destDn = ldap.search("CN=Users",
"(sAMAccountName="+uid+")");
if (destDn.length == 0 || destDn.length > 1) {
continue;
}
var destMemberDn = destDn.get(0) + "," +
ldap.getContextDn();
membersDstDn.push(destMemberDn);
}
membersDstDn
]]>
</string>
Thank you in advance for your help.
Try to force a java Array, at the end of the dataset script:
var resTab =
java.lang.reflect.Array.newInstance(java.lang.String,
membersDstDn.length);
for ( var i = 0 ; i < membersDstDn.length ; i++) {
resTab[i] = membersDstDn[i];
}
resTab
Clément.
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users