On Monday 22 August 2011 09:47:13 Sébastien Bahloul wrote:
> Hi Xavier,
>
> Can you pastebin the complete log file which may be located in /tmp/lsc.log
> ? I suggest you modify the following lines in the logback.xml configuration
>
>
> In the '<appender name="LSC" ...' node :
> from : <filter
> class="ch.qos.logback.classic.filter.ThresholdFilter"><level>INFO</level></
> filter> to : <filter
> class="ch.qos.logback.classic.filter.ThresholdFilter"><level>DEBUG</level><
> /filter>
>
> Near the end of the file :
> from : <root level="WARN">
> to : <root level="DEBUG">
Thank you very much for pointing me to the logback.xml configuration file. I
ignored this file file previously.
I found my bugs, it now works (with also the help of strace).
Three problems :
1/ In sql-map-config.xml, I had to add another "/" for the sqlMap file path :
<sqlMap url="file:///${lsc.config}/sql-map-config.d/InetOrgPerson.xml"/>
2/ A typo : lsc.tasks.MyTask.dstService.filterId = (mail={mail}))
Two parenthesis at the end !
3/ In sql-map-config.d/InetOrgPerson.xml :
<select id="getAliasRecord" resultClass="java.util.HashMap" ...>
instead of
<select id="getAliasRecord" resultMap="java.util.HashMap" ...>
4/ And I had to add the "sn" and "cn" attributes in lsc.properties, as they
are compulsory for the inetOrgPerson class ...
Thanks again,
>
> Regards,
>
> 2011/8/19 Xavier Montagutelli <[email protected]>
>
> > Hello list,
> >
> > I try to configure LSC 1.2.1 to synchronise a LDAP directory from a MySQL
> > source. Very simply, with one attribute only stored in a MySQL table ...
> >
> > # ../bin/lsc -f . -s MyTask
> > août 19 12:48:00 - INFO - Starting sync for MyTask
> > août 19 12:48:00 - ERROR - Error while launching task "MyTask". Please
> > check
> > your configuration! (java.lang.ExceptionInInitializerError)
> >
> > I don't know where to start with this message .... Any help would be
> > appreciated.
> >
> >
> > 1/ I installed mysql-connector-java-5.1.17-bin.jar under the lib/
> > directory
> >
> > 2/ lsc.properties :
> >
> > src.database.driver = com.mysql.jdbc.Driver
> > src.database.url = jdbc:mysql://mysql-host.univ.edu/db_name
> > src.database.username = USER
> > src.database.password = PASS
> >
> > dst.java.naming.provider.url = ldap://ldap.univ.edu/dc=univ,dc=edu
> > dst.java.naming.security.authentication = simple
> > dst.java.naming.security.principal = cn=admin,dc=univ,dc=edu
> > dst.java.naming.security.credentials = LDAP_PASSWORD
> > dst.java.naming.referral = ignore
> > dst.java.naming.ldap.derefAliases = never
> > dst.java.naming.factory.initial = com.sun.jndi.ldap.LdapCtxFactory
> > dst.java.naming.ldap.version = 3
> >
> > lsc.tasks = MyTask
> >
> > lsc.tasks.MyTask.srcService = org.lsc.service.SimpleJdbcSrcService
> > lsc.tasks.MyTask.srcService.requestNameForList = getAllAliases
> > lsc.tasks.MyTask.srcService.requestNameForObject = getAliasRecord
> >
> > lsc.tasks.MyTask.dstService = org.lsc.jndi.SimpleJndiDstService
> > lsc.tasks.MyTask.dstService.baseDn = ou=Aliases
> > lsc.tasks.MyTask.dstService.filterAll = (mail=*)
> > lsc.tasks.MyTask.dstService.pivotAttrs = mail
> > lsc.tasks.MyTask.dstService.filterId = (mail={mail}))
> > lsc.tasks.MyTask.dstService.attrs = objectClass mail
> > lsc.tasks.MyTask.bean = org.lsc.beans.SimpleBean
> > lsc.tasks.MyTask.dn = "mail=" + srcBean.getAttributeValueById("mail") +
> > ",ou=Aliases"
> > dn.real_root = dc=univ,dc=edu
> >
> > lsc.syncoptions.MyTask =
> > org.lsc.beans.syncoptions.PropertiesBasedSyncOptions
> > lsc.syncoptions.MyTask.default.action = F
> > lsc.syncoptions.MyTask.objectClass.create_value = "inetOrgPerson"
> > lsc.syncoptions.MyTask.mail.force_value =
> > srcBean.getAttributeValuesById("mail")
> >
> > 3/ sql-map-config.xml :
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE sqlMapConfig
> >
> > PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
> > "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
> >
> > <sqlMapConfig>
> >
> > <transactionManager type="JDBC">
> >
> > <dataSource type="SIMPLE">
> >
> > <property value="${driver}" name="JDBC.Driver" />
> > <property value="${url}" name="JDBC.ConnectionURL" />
> > <property value="${username}" name="JDBC.Username"/>
> > <property value="${password}" name="JDBC.Password"/>
> > <property value="15" name="Pool.MaximumActiveConnections"/>
> > <property value="15" name="Pool.MaximumIdleConnections"/>
> > <property value="1000" name="Pool.MaximumWait"/>
> >
> > </dataSource>
> >
> > </transactionManager>
> > <sqlMap url="file://${lsc.config}/sql-map-config.d/InetOrgPerson.xml"/>
> >
> > </sqlMapConfig>
> >
> > 4/ sql-map-config.d/InetOrgPerson.xml :
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> > <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
> > "http://www.ibatis.com/dtd/sql-map-2.dtd">
> >
> > <sqlMap namespace="InetOrgPerson">
> >
> > <select id="getAllAliases" resultClass="java.util.HashMap">
> >
> > SELECT alias
> > FROM aliases_domain
> >
> > </select>
> >
> > <select id="getAliasRecord" resultMap="java.util.HashMap"
> >
> > parameterClass="java.util.Map">
> >
> > SELECT alias as mail
> > FROM aliases_domain
> > WHERE alias = #alias#
> >
> > </select>
> >
> > </sqlMap>
> >
> > --
> > Xavier Montagutelli Tel : +33 (0)5 55 45 77 20
> > Service Commun Informatique Fax : +33 (0)5 55 45 75 95
> > Universite de Limoges
> > 123, avenue Albert Thomas
> > 87060 Limoges cedex
> > _______________________________________________________________
> > Ldap Synchronization Connector (LSC) - http://lsc-project.org
> >
> > lsc-users mailing list
> > [email protected]
> > http://lists.lsc-project.org/listinfo/lsc-users
--
Xavier Montagutelli Tel : +33 (0)5 55 45 77 20
Service Commun Informatique Fax : +33 (0)5 55 45 75 95
Universite de Limoges
123, avenue Albert Thomas
87060 Limoges cedex
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users