Hi Frédéric,

First can you check that you are using a Sun/Oracle Java Runtime
Environment 6/7 (and not an OpenJDK) ?

And try to use a Java array instead of a Native Javascript array as
explained there :

http://www.mozilla.org/rhino/ScriptingJava.html#creatingarrays

Javascript arrays should work, I will open an bug if you confirmed that
using Java arrays fixed your issue !

Regards,
-- 
Sebastien BAHLOUL
IAM / Security specialist
Ldap Synchronization Connector : http://lsc-project.org
Blog : http://sbahloul.wordpress.com/



2012/5/2 "POISSON Frédéric" <[email protected]>

> Hello,
>
> I'm testing LSC 2.0rc2 with a group membership synchronization
> configuration between an Active Directory source to a OpenLDAP destination.
> This configuration runs correctly with release 1.2, but when i import
> inside lsc.xml configuration it failed on an Javascript error
> java.lang.ClassNotFoundException: sun.org.mozilla.rhino.ScriptableObject.
>
> See attachment for output error and here is the configuration of
> uniqueMember attribute :
>
> Could you tell me if i made a mistake inside my lsc.xml ?
>
>                                 <dataset>
>                                         <name>uniqueMember</name>
>                                         <policy>FORCE</policy>
>                                         <forceValues>
>                                                 <string>
>         <![CDATA[js:
>         var dnRoot = "dc=example,dc=com";
>         var srcMembersNotFoundInDst = new Array();
>         var dstMembers = new Array();
>         var dnNoMembers = "uid=no_members,ou=Private," + dnRoot;
>         var srcMembers = new Array();
>         if ( srcBean.getDatasetById("member"))
>         {
>                 srcMembers = srcBean.getDatasetById("member").toArray() ;
>                 for (var i=0; i < srcMembers.length; i++ ) {
>                         try {
>                                 var sam = srcLdap.attribute(srcMembers[i],
> 'sAMAccountName').get(0);
>
> dstMembers.push(ldap.search("ou=People","(uid="+sam+")").get(0) + "," +
> dnRoot)
>                         }
>                         catch (e) {
>                                 srcMembersNotFoundInDst.push(
> srcMembers[i]);
>                         }
>                 }
>                 if ( srcMembersNotFoundInDst.length > 0 ) srcMembers =
> srcMembersNotFoundInDst.slice(0);
>                 srcMembersNotFoundInDst = [];
>                 for (var i=0; i < srcMembers.length; i++ ) {
>                         try {
>                                 var cn = srcLdap.attribute(srcMembers[i],
> 'cn').get(0);
>
> dstMembers.push(ldap.search("ou=Groups","(cn="  + cn + ")").get(0) + "," +
> dnRoot)
>                         }
>                         catch (e) {
>                                 srcMembersNotFoundInDst[i]=srcMembers[i];
>                         }
>                 }
>                 if ( dstMembers.length == 0) dstMembers.push( dnNoMembers);
>                 dstMembers
>         }
>         else
>         {
>                 dnNoMembers
>         }
>         ]]>
>                                                 </string>
>                                         </forceValues>
>                                 </dataset>
>
>
> The error seems to be the javascript array which is given as value instead
> of been taken as an multi valued attribute :
> ..
> uniqueMember: sun.org.mozilla.javascript.internal.NativeArray@78aa80
> ...
>
> It doesn't appear if i change script with "dstMembers[0]" or
> "dstMembers[1]" result. In that case it only synchronize the first member
> or second member of the Active Directory group.
>
> Is there a way to increase Javascript debugging output ?
>
> Thanks,
>
> --
> *Frederic Poisson*
>
>
> _______________________________________________________________
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>
> lsc-users mailing list
> [email protected]
> http://lists.lsc-project.org/listinfo/lsc-users
>
>
_______________________________________________________________
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