CMDBuild Forum

Basic-connector not working with LDAP

Hello All, 

 
I currently have basic-connector successfully syncing cards with my OCS inventory instance, I want to set up a separate instance to also sync Active Directory users. Here is my basic-connector.log file contents:
 
>>> Program Started  - version (Basic Connector 1.5.0 - 30/10/2013)<<<
Searching for: /root/basic-connector/ldap-sync/conf/configuration.xml
Parsing XML file [/root/basic-connector/ldap-sync/conf/configuration.xml]
Ended to read configuration file
Trasform file foundtrue
Parsing XML file [/root/basic-connector/ldap-sync/conf/cmdbuild-schema.xml]
LDAP object NOT contains the key
LDAP object NOT contains the key
Interceptor for {http://soap.services.cmdbuild.org}PrivateService#{http://soap.services.cmdbuild.org}getCardList has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:544)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:294)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
        at com.sun.proxy.$Proxy48.getCardList(Unknown Source)
        at org.cmdbuild.externalconnector.inventory.data.GetDataFromCMDBuild.isNewCard(GetDataFromCMDBuild.java:119)
        at org.cmdbuild.externalconnector.update.LDAPConnector.connect(LDAPConnector.java:119)
        at org.cmdbuild.externalconnector.update.UpdateCMDBuild.main(UpdateCMDBuild.java:45)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://://services/soap/Private
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2308)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2239)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2082)
        at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:730)
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 10 more
 
My config file is as follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
        <cmdbuild>
                <ServerAddress>127.0.0.1</ServerAddress>
                <ServerContext>cmdbuild</ServerContext>
                <ServerPort>8080</ServerPort>
                <Username>workflow</Username>
                <Password>workflow</Password>
        </cmdbuild>
        <serverldap>
                <ServerAddress>10.40.213.10</ServerAddress>
                <port>389</port>
                <SSL>0</SSL>
                <User>user@company.local</User>
                <Password>secretpassword</Password>
                <DN>OU=DC,OU=US,OU=North%20America,OU=Corporate,DC=rosettastone,DC=local</DN>
                <Class>Users</Class>
                <Search>objectClass=*</Search>
                <Attributes>sAMAccountName</Attributes>
                <Key>sAMAccountName</Key>
        </serverldap>
</configuration>
 
My transform.xsl is as follows: 
 
 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0">
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
                 indent="yes" />
        <xsl:template match="/">
                <CMDBUILD>
                        <xsl:apply-templates />
                </CMDBUILD>
        </xsl:template>
        <xsl:template match="*">
                <xsl:apply-templates />
        </xsl:template>
        <xsl:template match="text()"></xsl:template>
        <xsl:template match="/serverldap/Corporate">
                <Employee key="sAMAccountName">
                        <sAMAccountName>
                                <xsl:value-of select="./sAMAccountName" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
        <xsl:template match="/CMDBUILD/Employee">
                <Employee key="sAMAccountName">
                        <xsl:attribute name="objid">
                                <xsl:value-of select="./@objid" />
                        </xsl:attribute>
                        <sAMAccountName>
                                <xsl:value-of select="./Code" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
</xsl:stylesheet>
 
 
And my cmdbuild-schema is like so:
 
 
<?xml version="1.0"?>
<CMDBUILD>
        <Employee>
               <sAMAccountName />
        </Employee>
</CMDBUILD>
 
 
I had initially tried performing the sync with many more attributes, however to try to narrow isolate the issue, I removed everything except the value I wanted to use as "Key"
 
cmdbuild.log, shark.log, and catalina.out all return no errors or even acknowledge that the connector has been run. Any help would be appreciated as I know Shark is working correctly and that my CMDBuild/User settings are correct, given the connector does work with OCS Inventory.
 
Thanks 
 
 
Can anyone provide an example of their configuration in which this connector is working with LDAP?
 
Previously Matt wrote:
Hello All, 
 
I currently have basic-connector successfully syncing cards with my OCS inventory instance, I want to set up a separate instance to also sync Active Directory users. Here is my basic-connector.log file contents:
 
>>> Program Started  - version (Basic Connector 1.5.0 - 30/10/2013)<<<
Searching for: /root/basic-connector/ldap-sync/conf/configuration.xml
Parsing XML file [/root/basic-connector/ldap-sync/conf/configuration.xml]
Ended to read configuration file
Trasform file foundtrue
Parsing XML file [/root/basic-connector/ldap-sync/conf/cmdbuild-schema.xml]
LDAP object NOT contains the key
LDAP object NOT contains the key
Interceptor for {http://soap.services.cmdbuild.org}PrivateService#{http://soap.services.cmdbuild.org}getCardList has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:544)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:294)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
        at com.sun.proxy.$Proxy48.getCardList(Unknown Source)
        at org.cmdbuild.externalconnector.inventory.data.GetDataFromCMDBuild.isNewCard(GetDataFromCMDBuild.java:119)
        at org.cmdbuild.externalconnector.update.LDAPConnector.connect(LDAPConnector.java:119)
        at org.cmdbuild.externalconnector.update.UpdateCMDBuild.main(UpdateCMDBuild.java:45)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://://services/soap/Private
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2308)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2239)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2082)
        at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:730)
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 10 more
 
My config file is as follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
        <cmdbuild>
                <ServerAddress>127.0.0.1</ServerAddress>
                <ServerContext>cmdbuild</ServerContext>
                <ServerPort>8080</ServerPort>
                <Username>workflow</Username>
                <Password>workflow</Password>
        </cmdbuild>
        <serverldap>
                <ServerAddress>10.40.213.10</ServerAddress>
                <port>389</port>
                <SSL>0</SSL>
                <User>user@company.local</User>
                <Password>secretpassword</Password>
                <DN>OU=DC,OU=US,OU=North%20America,OU=Corporate,DC=rosettastone,DC=local</DN>
                <Class>Users</Class>
                <Search>objectClass=*</Search>
                <Attributes>sAMAccountName</Attributes>
                <Key>sAMAccountName</Key>
        </serverldap>
</configuration>
 
My transform.xsl is as follows: 
 
 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0">
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
                 indent="yes" />
        <xsl:template match="/">
                <CMDBUILD>
                        <xsl:apply-templates />
                </CMDBUILD>
        </xsl:template>
        <xsl:template match="*">
                <xsl:apply-templates />
        </xsl:template>
        <xsl:template match="text()"></xsl:template>
        <xsl:template match="/serverldap/Corporate">
                <Employee key="sAMAccountName">
                        <sAMAccountName>
                                <xsl:value-of select="./sAMAccountName" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
        <xsl:template match="/CMDBUILD/Employee">
                <Employee key="sAMAccountName">
                        <xsl:attribute name="objid">
                                <xsl:value-of select="./@objid" />
                        </xsl:attribute>
                        <sAMAccountName>
                                <xsl:value-of select="./Code" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
</xsl:stylesheet>
 
 
And my cmdbuild-schema is like so:
 
 
<?xml version="1.0"?>
<CMDBUILD>
        <Employee>
               <sAMAccountName />
        </Employee>
</CMDBUILD>
 
 
I had initially tried performing the sync with many more attributes, however to try to narrow isolate the issue, I removed everything except the value I wanted to use as "Key"
 
cmdbuild.log, shark.log, and catalina.out all return no errors or even acknowledge that the connector has been run. Any help would be appreciated as I know Shark is working correctly and that my CMDBuild/User settings are correct, given the connector does work with OCS Inventory.
 
Thanks 
 
 

 

Sorry for multiple replies, however I think I found a problem with the source code for the connector and figured I should share.
 
If you compare how the connector collects configuration information for LDAP operations and Inventory operations, you will see an irregularity that could explain why the connector is unable to reach my CMDBuild instance as indicated in the error message posted above.
 
Here are two snippets of code from the source where the configuration data is being determined
 
InventoryConnector.java: (This code works)
    String CMDBuild_ServerIP = cf.getCMDBuild_ServerIP();
    String CMDBuild_ServerPort = cf.getCMDBuild_ServerPort();
    String CMDBuild_Context = cf.getCMDBuild_Context();
    String CMDBuild_Username = cf.getCMDBuild_UserName();
    String CMDBuild_Password = cf.getCMDBuild_Password();
 
    String Inventory_DB_Type = cf.getInventory_DB_Type();
    String Inventory_DB_IP = cf.getInventory_DB_IP();
    String Inventory_DB_Port = cf.getInventory_DB_Port();
    String Inventory_DB_Name = cf.getInventory_DB_Name();
    String Inventory_DB_User = cf.getInventory_DB_User();
    String Inventory_DB_Pwd = cf.getInventory_DB_Pwd();
    String Inventory_DB_InstanceName = cf.getInventory_DB_InstaceName();
 
LDAPConnector.java: (This is what I suspect is broken)
 
String CMDBuild_ServerIP = cf.get("cmdbuild.Server.Address");
String CMDBuild_ServerPort = cf.get("cmdbuild.Server.Port");
String CMDBuild_Context = cf.get("cmdbuild.Server.Context");
String CMDBuild_Username = cf.get("cmdbuild.Server.Username");
String CMDBuild_Password = cf.get("cmdbuild.Server.Password");
String classCMDBuild  = cf.get("cmdbuild.Database.Table");
String keyCMDBuild = cf.get("cmdbuild.Database.Key");
String searchLDAP      = cf.get("serverldap.Search");
String classLDAP      = cf.get("serverldap.Class");
String keyLDAP      = cf.get("serverldap.Key");
String attributesLDAP = cf.get("serverldap.Attributes");
String returnedAtts[] = attributesLDAP.split(",");
 
I am currently trying to recompile the code with LDAPConnector.java changed like so...
 
    String CMDBuild_ServerIP = cf.getCMDBuild_ServerIP();
    String CMDBuild_ServerPort = cf.getCMDBuild_ServerPort();
    String CMDBuild_Context = cf.getCMDBuild_Context();
    String CMDBuild_Username = cf.getCMDBuild_UserName();
    String CMDBuild_Password = cf.getCMDBuild_Password();
 
String classCMDBuild  = cf.get("cmdbuild.Database.Table");
String keyCMDBuild = cf.get("cmdbuild.Database.Key");
String searchLDAP      = cf.get("serverldap.Search");
String classLDAP      = cf.get("serverldap.Class");
String keyLDAP      = cf.get("serverldap.Key");
String attributesLDAP = cf.get("serverldap.Attributes");
String returnedAtts[] = attributesLDAP.split(",");
 
I'm having some issues compiling using maven due to it being unable to resolve the cmdbuild-ws-client dependency, however I thought I would share this information in the mean time.
 
 
 
 
Previously Matt wrote:
Hello All, 
 
I currently have basic-connector successfully syncing cards with my OCS inventory instance, I want to set up a separate instance to also sync Active Directory users. Here is my basic-connector.log file contents:
 
>>> Program Started  - version (Basic Connector 1.5.0 - 30/10/2013)<<<
Searching for: /root/basic-connector/ldap-sync/conf/configuration.xml
Parsing XML file [/root/basic-connector/ldap-sync/conf/configuration.xml]
Ended to read configuration file
Trasform file foundtrue
Parsing XML file [/root/basic-connector/ldap-sync/conf/cmdbuild-schema.xml]
LDAP object NOT contains the key
LDAP object NOT contains the key
Interceptor for {http://soap.services.cmdbuild.org}PrivateService#{http://soap.services.cmdbuild.org}getCardList has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:544)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:294)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
        at com.sun.proxy.$Proxy48.getCardList(Unknown Source)
        at org.cmdbuild.externalconnector.inventory.data.GetDataFromCMDBuild.isNewCard(GetDataFromCMDBuild.java:119)
        at org.cmdbuild.externalconnector.update.LDAPConnector.connect(LDAPConnector.java:119)
        at org.cmdbuild.externalconnector.update.UpdateCMDBuild.main(UpdateCMDBuild.java:45)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://://services/soap/Private
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2308)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2239)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2082)
        at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:730)
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 10 more
 
My config file is as follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
        <cmdbuild>
                <ServerAddress>127.0.0.1</ServerAddress>
                <ServerContext>cmdbuild</ServerContext>
                <ServerPort>8080</ServerPort>
                <Username>workflow</Username>
                <Password>workflow</Password>
        </cmdbuild>
        <serverldap>
                <ServerAddress>10.40.213.10</ServerAddress>
                <port>389</port>
                <SSL>0</SSL>
                <User>user@company.local</User>
                <Password>secretpassword</Password>
                <DN>OU=DC,OU=US,OU=North%20America,OU=Corporate,DC=rosettastone,DC=local</DN>
                <Class>Users</Class>
                <Search>objectClass=*</Search>
                <Attributes>sAMAccountName</Attributes>
                <Key>sAMAccountName</Key>
        </serverldap>
</configuration>
 
My transform.xsl is as follows: 
 
 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0">
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
                 indent="yes" />
        <xsl:template match="/">
                <CMDBUILD>
                        <xsl:apply-templates />
                </CMDBUILD>
        </xsl:template>
        <xsl:template match="*">
                <xsl:apply-templates />
        </xsl:template>
        <xsl:template match="text()"></xsl:template>
        <xsl:template match="/serverldap/Corporate">
                <Employee key="sAMAccountName">
                        <sAMAccountName>
                                <xsl:value-of select="./sAMAccountName" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
        <xsl:template match="/CMDBUILD/Employee">
                <Employee key="sAMAccountName">
                        <xsl:attribute name="objid">
                                <xsl:value-of select="./@objid" />
                        </xsl:attribute>
                        <sAMAccountName>
                                <xsl:value-of select="./Code" />
                        </sAMAccountName>
 
                </Employee>
        </xsl:template>
</xsl:stylesheet>
 
 
And my cmdbuild-schema is like so:
 
 
<?xml version="1.0"?>
<CMDBUILD>
        <Employee>
               <sAMAccountName />
        </Employee>
</CMDBUILD>
 
 
I had initially tried performing the sync with many more attributes, however to try to narrow isolate the issue, I removed everything except the value I wanted to use as "Key"
 
cmdbuild.log, shark.log, and catalina.out all return no errors or even acknowledge that the connector has been run. Any help would be appreciated as I know Shark is working correctly and that my CMDBuild/User settings are correct, given the connector does work with OCS Inventory.
 
Thanks 
 
 

 

Hey, Matt, did you finally find any solution?

I had the same problem with LDAP & Basic connector and I am now trying to modify and re-compile the LDAPConnector.java file.

However, I have to face the missing artifact (maven dependency) org.cmdbuild:cmdbuild-ws-client:jar:2.1.5-SNAPSHOT . It's missing from maven repository.

Any help please, from CMDBuild team or Matt ?

 

Regards

 

Previously Matt wrote:
... 
I'm having some issues compiling using maven due to it being unable to resolve the cmdbuild-ws-client dependency, however I thought I would share this information in the mean time.
...