Hi Frédéric,

I've just done some tests and it seems that the 2.0 branch has an issue
that has been fixed on the trunk. Have you the time to get a try with the
same configuration except the conversion to a native Java array and provide
us the corresponding feedback ?

An issue has been opened: http://tools.lsc-project.org/issues/469

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



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

> Hi Sebastien,
>
> I found a solution for group member ship. As i'm not a java/javascript
> developer i didn't succeed to all rewrite javascript code with javascript
> array to java constructor. Especially because javascript array do not need
> a size definition while Java array need one.
>
> So i just convert my javascript array at the end of the script when i have
> to return the "uniquemember" array. Here is the code, where for me it works
> on membership changes, on empty groups. Now is possible to have an
> explanation on this modification of behavior inside javascript utilization ?
>
>
>
> * *                               <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);
>                 var jArr =
> java.lang.reflect.Array.newInstance(java.lang.String, dstMembers.length);
>                 for (var i = 0; i < dstMembers.length; i++) { jArr[i] =
> dstMembers[i]; }
>                 jArr
>         }
>         else
>         {
>                 dnNoMembers
>         }
>         ]]>
>                                                 </string>
>                                         </forceValues>
>                                 </dataset>
>
>
> Regards,
>
> Le 03/05/12, *Sébastien Bahloul * <[email protected]> a écrit :
>
> Hi Frédéric,
>
> As mentionned in the link sent before, try to initialize your destination
> array through a Java constructor :
>
>
> var dstMembers = java.lang.reflect.Array.newInstance(java.lang.String, 
> srcBean.getDatasetById("member").size());
>
>
> 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]>
>
>> Hi Sébastien,
>>
>> Here is the java version used :
>>
>> # /usr/java/jdk1.6.0_23/bin/java -version
>> java version "1.6.0_23"
>> Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
>> Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
>> # rpm -qf /usr/java/jdk1.6.0_23/bin/java
>> jdk-1.6.0_23-fcs.i586
>> # rpm -qi jdk-1.6.0_23-fcs.i586
>> Name        : jdk                          Relocations: /usr/java
>> Version     : 1.6.0_23                          Vendor: Oracle and/or its
>> affiliates.
>> Release     : fcs                           Build Date: Sat 13 Nov 2010
>> 01:54:11 AM CET
>> Install Date: Tue 05 Jul 2011 11:39:53 AM CEST      Build Host:
>> jdk-lin-1586
>> Group       : Development/Tools             Source RPM:
>> jdk-1.6.0_23-fcs.src.rpm
>> Size        : 148955915                        License: Copyright (c)
>> 2010, Oracle and/or its affiliates. All rights reserved. Also under other
>> license(s) as shown at the Description field.
>> Signature   : (none)
>> Packager    : Java Software <[email protected]>
>> URL         : http://java.sun.com/
>> Summary     : Java(TM) Platform Standard Edition Development Kit
>> Description :
>> The Java Platform Standard Edition Development Kit (JDK) includes both
>> the runtime environment (Java virtual machine, the Java platform classes
>> and supporting files) and development tools (compilers, debuggers,
>> tool libraries and other tools).
>>
>> The JDK is a development environment for building applications, applets
>> and components that can be deployed with the Java Platform Standard
>> Edition Runtime Environment.
>>
>> This is not the latest one but this is a Sun/Oracle JDK.
>>
>> Do you have some sample code which are using a Java array ?
>>
>> And just for your information i have another dataset for mailLocalAddress
>> using array which correctly work :
>>
>>                                 <dataset>
>>                                         <name>mailLocalAddress</name>
>>
>>                                         <policy>FORCE</policy>
>>                                         <forceValues>
>>                                                 <string>
>>         <![CDATA[js:
>>         var mails ;
>>         if (srcBean.getDatasetById("proxyAddresses") )
>>         {
>>                 mails =
>> srcBean.getDatasetById("proxyAddresses").toArray();
>>                 for (var i=0; i<mails.length; i++ )
>>                 {
>>                         mails[i] = mails[i].replace("smtp:","");
>>                 }
>>         }
>>         mails
>>         ]]>
>>                                                 </string>
>>                                         </forceValues>
>>                                 </dataset>
>>
>> Regards,
>>
>> Le 02/05/12, *Sébastien Bahloul * <[email protected]> a écrit :
>>
>> 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 java_script array as
>> explained there :
>>
>> http://www.mozilla.org/rhino/ScriptingJava.html#creatingarrays
>>
>> java_script 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 java_script 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 java_script array which is given as value
>>> instead of been taken as an multi valued attribute :
>>> ..
>>> uniqueMember: sun.org.mozilla.java_script.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 java_script 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
>>>
>>>
>> --
>>
>>
>>
>> *Frederic
>> Poisson*
>> ITD/I&E/ENG/MES/Messaging Engineering, LDAP/DNS Engineer
>>
>>
>>
>>
>>
>> tel.
>> +33 2 23 28 42 67
>> [email protected]
>> Cesson
>> Chene Germain 9 Rue du Chene Germain 35510 Cesson-Sevigne France
>> www.orange-business.com
>>
>>
> --
>
>
>
> *Frederic
> Poisson*
> ITD/I&E/ENG/MES/Messaging Engineering, LDAP/DNS Engineer
>
>
>
>
>
> tel.
> +33 2 23 28 42 67
> [email protected]
> Cesson
> Chene Germain 9 Rue du Chene Germain 35510 Cesson-Sevigne France
> www.orange-business.com
>
>
_______________________________________________________________
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