2013/12/9 Xavier Beaudouin <[email protected]> > Dear All, > > I have googled long time, but I cannot figure why the XML file I gave > according to the online tutorial : > > > http://lsc-project.org/wiki/documentation/2.0/tutorials/openldaptoactivedirectory > > I have 2 servers : > One is AD on 10.1.1.1 with password WTF > One is openldap 10.2.2.2 with password WTF2 > > When trying to validate and test the configuration file the lsc barf itsef > with the nice java backtrace : > > > Dec 09 12:39:58 - DEBUG - Loading XML configuration from: > /home/sadm/lsc-openldap2ad/etc/lsc.xml > Dec 09 12:39:58 - INFO - Reflections took 220 ms to scan 1 urls, > producing 51 keys and 103 values > Dec 09 12:39:58 - DEBUG - Importing XML schema file: > schemas/lsc-core-2.0.xsd > Dec 09 12:39:58 - ERROR - org.lsc.exception.LscConfigurationException: > javax.xml.bind.UnmarshalException > - with linked exception: > [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content > was found starting with element 'pivotAttributes'. One of '{" > http://lsc-project.org/XSD/lsc-core-2.0.xsd":cleanFilter, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":filterAsync, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":dateFormat, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":interval}' is expected.] > org.lsc.exception.LscConfigurationException: > javax.xml.bind.UnmarshalException > - with linked exception: > [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content > was found starting with element 'pivotAttributes'. One of '{" > http://lsc-project.org/XSD/lsc-core-2.0.xsd":cleanFilter, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":filterAsync, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":dateFormat, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":interval}' is expected.] > at > org.lsc.configuration.JaxbXmlConfigurationHelper.getConfiguration(JaxbXmlConfigurationHelper.java:172) > ~[lsc-core-2.0.3.jar:na] > at org.lsc.Configuration.setUp(Configuration.java:481) > ~[lsc-core-2.0.3.jar:na] > at org.lsc.Launcher.run(Launcher.java:195) [lsc-core-2.0.3.jar:na] > at org.lsc.Launcher.launch(Launcher.java:159) > [lsc-core-2.0.3.jar:na] > at org.lsc.Launcher.main(Launcher.java:142) [lsc-core-2.0.3.jar:na] > Caused by: javax.xml.bind.UnmarshalException: null > at > javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:505) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:206) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173) > ~[na:1.6.0_45] > at > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137) > ~[na:1.6.0_45] > at > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:142) > ~[na:1.6.0_45] > at > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:151) > ~[na:1.6.0_45] > at > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:169) > ~[na:1.6.0_45] > at > org.lsc.configuration.JaxbXmlConfigurationHelper.getConfiguration(JaxbXmlConfigurationHelper.java:170) > ~[lsc-core-2.0.3.jar:na] > ... 4 common frames omitted > Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid > content was found starting with element 'pivotAttributes'. One of '{" > http://lsc-project.org/XSD/lsc-core-2.0.xsd":cleanFilter, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":filterAsync, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":dateFormat, " > http://lsc-project.org/XSD/lsc-core-2.0.xsd":interval}' is expected. > at > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:423) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3188) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1812) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:711) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:551) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:78) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:135) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) > ~[na:1.6.0_45] > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) > ~[na:1.6.0_45] > at > com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200) > ~[na:1.6.0_45] > ... 10 common frames omitted > Dec 09 12:39:58 - INFO - Configuration validation failed ! > > > Which I can consider there is somewhere in pivotAttributes tags and error. > > Now I cannot figure what is the right error since I took the time to copy > and paste the tutorials, and add a tripple check of the configuration file. > > BTW here is the configuratio file : > > <?xml version="1.0" ?> > <lsc xmlns="http://lsc-project.org/XSD/lsc-core-2.0.xsd" revision="0"> > <connections> > <ldapConnection> > <name>AD1</name> > <url>ldap://10.1.1.1/dc=fsck,dc=local</url> > <username>cn=Administrator,cn=Users,dc=fsck,dc=local</username> > <password>WTF</password> > <authentication>SIMPLE</authentication> > <version>VERSION_3</version> > <pageSize>1000</pageSize> > <factory>com.sun.jndi.ldap.LdapCtxFactory</factory> > <tlsActivated>false</tlsActivated> > </ldapConnection> > <ldapConnection> > <name>openldap</name> > <url>ldap://10.2.2.2:389/dc=hsoftware,dc=com</url> > <username>cn=admin,dc=fsck,dc=com</username> > <password>WTF2</password> > <authentication>SIMPLE</authentication> > <factory>com.sun.jndi.ldap.LdapCtxFactory</factory> > <tlsActivated>false</tlsActivated> > </ldapConnection> > </connections> > > <tasks> > <task> > <name>adUser</name> > <bean>org.lsc.beans.SimpleBean</bean> > <ldapSourceService> > <name>openldap-dst-service</name> > <connection reference="openldap-dst-conn" /> > <baseDn>ou=people,dc=fsck,dc=com</baseDn> > > <getAllFilter>(&(uid=*)(objectClass=inetOrgPerson))</getAllFilter> > > <getOneFilter>(&(objectClass=user)(sAMAccountName={uid}))</getOneFilter> > <pivotAttributes> > <string>uid</string> > </pivotAttributes> > </ldapSourceService> > <ldapSourceService> > <name>ad-src-service</name> > <basedn>cn=Users,dc=fsck,dc=local</basedn> > > <getAllFilter>(&(sAMAccountName=*)(objectClass=user))</getAllFilter> > > <getOneFilter>(&(objectClass=inetOrgPerson)(uid={uid}))</getOneFilter> > <pivotAttributes> > <string>sAMAccountName</string> > </pivotAttributes> > </ldapDestinationService> > <propertiesBasedSyncOptions> > <defaultPolicy>FORCE</defaultPolicy> > <defaultDelimiter>;</defaultDelimiter> > <dataset> > <name>objectClass</name> > <policy>FORCE</policy> > <forceValues> > > <string>"top";"user";"person";"organizationalPerson"</string> > </forceValues> > </dataset> > <dataset> > <name>sAMAccountName</name> > <policy>KEEP</policy> > <createValues> > > <string>srcBean.getDatasetFirstValueById("uid")</string> > </createValues> > </dataset> > <dataset> > <!-- userPrincipalName = uid + "@hsoftware.local" > --> > <name>userPrincipalName</name> > <policy>FORCE</policy> > <forceValues> > > <string>srcBean.getDatasetFirstValueById("uid") + "@fsck.local"</string> > </forceValues> > </dataset> > <dataset> > <name>userAccountControl</name> > <policy>KEEP</policy> > <createValues> > <string>AD.userAccountControlSet( "0", > [AD.UAC_SET_NORMAL_ACCOUNT])</string> > </createValues> > </dataset> > <dataset> > <!-- pwdLastSet = 0 to force user to change > password on next connection --> > <name>pwdLastSet</name> > <policy>KEEP</policy> > <createValues> > <string>"0"</string> > </createValues> > </dataset> > <dataset> > <!-- unicodePwd = "changeit" at creation (requires > SSL connection to AD) --> > <name>unicodePwd</name> > <policy>KEEP</policy> > <createValues> > > <string>AD.getUnicodePwd("changeit")</string> > </createValues> > </dataset> > </propertiesBasedSyncOptions> > </task> > </tasks> > </lsc> > > > Any clues ? because I stuck on it... :/ > >
In LSC configuration, order of markups matters. In a service : - name - connection - baseDN - pivotAttributes - fetchedAttributes - getAllFilter - getOneFilter - cleanFilter See for example http://lsc-project.org/wiki/documentation/2.0/configuration/service/sourceldap Clément.
_______________________________________________________________ Ldap Synchronization Connector (LSC) - http://lsc-project.org lsc-users mailing list [email protected] http://lists.lsc-project.org/listinfo/lsc-users

