2015-01-28 18:50 GMT+01:00 W. Ho <[email protected]>:
> Hi Clément,
>
> I tested it with "js" only, it works the same way as "rjs" for both CentOS 6
> and 7 when Java 7 was invoked.  Group members are correctly parsed and
> populated into OpenLDAP.  However, both failed with the same error message
> when Java 8 was invoked.
>
> The error message is always the same:
> [LDAP: error code 21 - member: value #0 invalid per syntax]
>
> It seems to me that Java 7 recognizes that member is an array and pulls each
> element properly but Java 8 behaves differently and fails to parse the
> elements.

Well, I have no idea why it fails.

A solution could be to force the use Java Array instead of Javascript
Array. See this sample code:


                                <![CDATA[
                                var membersSrcDn =
srcBean.getDatasetValuesById("member").toArray().slice(0);
                                var memberIdValues = [];
                                for  (var i=0; i<membersSrcDn.length; i++) {
                                        var memberSrcDn = membersSrcDn[i];
                                        var id = "";
                                        if (
memberSrcDn.indexOf("ou=users") != -1 ) {
                                                try {
                                                        id =
srcLdap.attribute(memberSrcDn, "entryUUID").get(0);
                                                } catch(e) {
                                                        continue;
                                                }
                                                memberIdValues.push(id);
                                        }
                                }
                                var resTab =
java.lang.reflect.Array.newInstance(java.lang.String,

memberIdValues.length);

                                for (var j=0; j< memberIdValues.length; j++) {
                                        resTab[j] = memberIdValues[j];
                                }
                                resTab
                                ]]>


In this example, the restab array is created as a Java Array.


Clément.
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to