I am experiencing sporadic null pointer exceptions when running LSC. My tasks
are setup to sync between AD and an Oracle DB. The null pointer exception
seems to occur when running more than one thread.
If I execute it with:
bin/lsc -t1 -f etc/ -s AD-Accounts
The sync usually completes successfully. If I utilize more than one thread,
the sync process will, more often than not, fail.
bin/lsc -t10 -f etc/ -s AD-Accounts
Error message:
Jul 08 14:05:50 - DEBUG - In object "CN=XXXXXXXXXXXXXXXXXXXXXXXX": List of
attributes considered for writing in destination: [null, sid, usncreated,
distinguishedname, usnchanged, description, objectsid, objectguid]
Jul 08 14:05:50 - DEBUG - In object "CN=XXXXXXXXXXXXXXXXXXXXXXXX ": Attribute
"null" is in FORCE status
Jul 08 14:05:50 - ERROR - Error while synchronizing ID {distinguishedname=CN=
XXXXXXXXXXXXXXXXXXXXXXXX }: java.lang.NullPointerException
Jul 08 14:05:50 - DEBUG - java.lang.NullPointerException
java.lang.NullPointerException: null
at org.lsc.beans.LscBean.getDatasetById(LscBean.java:113)
~[lsc-core-2.1.3.jar:na]
at
org.lsc.beans.BeanComparator.getUpdatedObject(BeanComparator.java:264)
~[lsc-core-2.1.3.jar:na]
at
org.lsc.beans.BeanComparator.calculateModifications(BeanComparator.java:176)
~[lsc-core-2.1.3.jar:na]
at org.lsc.SynchronizeTask.run(AbstractSynchronize.java:773)
[lsc-core-2.1.3.jar:na]
at org.lsc.SynchronizeTask.run(AbstractSynchronize.java:707)
[lsc-core-2.1.3.jar:na]
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[na:1.6.0_31]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[na:1.6.0_31]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_31]
Tasks:
<tasks>
<task>
<name>AD-Accounts</name>
<bean>org.lsc.beans.SimpleBean</bean>
<ldapSourceService>
<name>AD-source-service</name>
<connection reference="XXX" />
<baseDn>XXXX</baseDn>
<pivotAttributes>
<string>distinguishedname</string>
</pivotAttributes>
<fetchedAttributes>
<string>sid</string>
<string>distinguishedname</string>
<string>objectguid</string>
<string>objectSid</string>
<string>description</string>
<string>usncreated</string>
<string>usnchanged</string>
</fetchedAttributes>
<getAllFilter>(&(sAMAccountType=805306368)(distinguishedname=*))</getAllFilter>
<getOneFilter>(&(sAMAccountType=805306368)(distinguishedname={distinguishedname}))</getOneFilter>
<cleanFilter>(&(sAMAccountType=805306368)(distinguishedname={distinguishedname}))</cleanFilter>
</ldapSourceService>
<databaseDestinationService>
<name>db-destination-service</name>
<connection reference="XXXXXX" />
<requestNameForList>getInetOrgPersonList</requestNameForList>
<requestNameForObject>getInetOrgPerson</requestNameForObject>
<requestsNameForInsert><string>insertInetOrgPerson</string></requestsNameForInsert>
<requestsNameForUpdate><string>updateInetOrgPerson</string></requestsNameForUpdate>
<requestsNameForDelete><string>deleteInetOrgPerson</string></requestsNameForDelete>
</databaseDestinationService>
<propertiesBasedSyncOptions>
<mainIdentifier>srcBean.getMainIdentifier()</mainIdentifier>
<defaultDelimiter>;</defaultDelimiter>
<defaultPolicy>FORCE</defaultPolicy>
<conditions>
<update><![CDATA[ srcBean.getDatasetFirstValueById('usnchanged') >
dstBean.getDatasetFirstValueById('usnchanged') ]]></update>
<changeId>false</changeId>
</conditions>
<dataset>
<name>OBJECTSID</name>
<policy>FORCE</policy>
<forceValues>
<string><![CDATA[js:
var strSID = "S-1-";
var s = srcBean.getDatasetById("objectSid").iterator().next();
var rid = ""
for (var i=2;i<=7;i++) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + parseInt(rid,16).toString();
rid = "";
var start = 8;
for (var x=0;x<=4;x++) {
for(var i=start+3;i>=start;i--) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + "-" + parseInt(rid,16).toString();
start = start + 4;
rid = ""
}
OBJECTSID=strSID;
OBJECTSID
]]>
</string>
</forceValues>
</dataset>
<dataset>
<name>objectguid</name>
<policy>FORCE</policy>
<forceValues>
<string>
<![CDATA[js:
var strSID;
var s = srcBean.getDatasetById("objectguid").iterator().next();
var rid = ""
for (var i=3;i>=0;i--) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = rid.toString();
rid = "";
for (var i=5;i>=4;i--) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + "-" + rid.toString();
rid = "";
for (var i=7;i>=6;i--) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + "-" + rid.toString();
rid = "";
for (var i=8;i<=9;i++) {
h=(s[i]&0xFF).toString(16);
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + "-" + rid.toString();
rid = "";
for (var i=10;i<=15;i++) {
h=(s[i]&0xFF).toString(16);
rid+=(h.length<2)?"0"+h:h;
}
strSID = strSID + "-" + rid.toString();
OBJECTGUID=strSID;
OBJECTGUID
]]>
</string>
</forceValues>
</dataset>
</propertiesBasedSyncOptions>
</task>
InetOrgPerson.xml
<select id="getInetOrgPerson" resultClass="java.util.HashMap"
parameterClass="java.util.Map">
select sid, distinguishedname, objectSid, objectguid, description,
usncreated, usnchanged from ad_accounts_1 where distinguishedname =
#distinguishedname#
</select>
<insert id="insertInetOrgPerson" parameterClass="java.util.Map">
insert into ad_accounts_1 (sid, distinguishedname, objectsid,
objectguid, description, usncreated, usnchanged) values (#sid#,
#distinguishedname#, #objectsid#, #objectguid#, #description#, #usncreated#,
#usnchanged#)
</insert>
<update id="updateInetOrgPerson" parameterClass="java.util.Map">
update ad_accounts_1
set sid = #sid#,
objectguid = #objectguid#,
objectsid = #objectsid#,
description = #description#,
usncreated = #usncreated#,
usnchanged = #usnchanged#
where distinguishedname = #distinguishedname#
</update>
<delete id="deleteInetOrgPerson" parameterClass="java.util.Map">
update ad_accounts_1
set dw_active_ind = 0
where distinguishedname = #distinguishedname#
</delete>
<select id="getInetOrgPersonList" resultClass="java.util.HashMap">
select distinguishedname
from ad_accounts_1
</select>
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data and
other information are not warranted as to completeness or accuracy and are
subject to change without notice. Any comments or statements made herein do
not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and
affiliates (collectively, "JPMC").
This transmission may contain information that is proprietary, privileged,
confidential and/or exempt from disclosure under applicable law. If you are
not the intended recipient, you are hereby notified that any disclosure,
copying, distribution, or use of the information contained herein (including
any reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission in error, please immediately contact the sender and destroy the
material in its entirety, whether in electronic or hard copy format. Although
this transmission and any attachments are believed to be free of any virus or
other defect that might affect any computer system into which it is received
and opened, it is the responsibility of the recipient to ensure that it is
virus free and no responsibility is accepted by JPMC for any loss or damage
arising in any way from its use. Please note that any electronic communication
that is conducted within or through JPMC's systems is subject to interception,
monitoring, review, retention and external production in accordance with JPMC's
policy and local laws, rules and regulations; may be stored or otherwise
processed in countries other than the country in which you are located; and
will be treated in accordance with JPMC policies and applicable laws and
regulations.
Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures
relating to European legal entities.
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users