Add relation in existing Assets using the collibra-integration-library 1.0.2 API
Hi @spring-team.collibra.com ,
Can someone guide me how can i fetch the existing asset from collibra and add the relation to that. i am using spring boot application to do this. Please refer below screenshot
Thanks in advance.
pratikmori
Posted 4 years ago · Edited 1 year ago·Last reply 4 years ago
28 comments
springboot_team
·4 years ago · EditedHello Pratik,
Just to let you know that the updated version of the Spring Boot Integration Library, having version 1.1.4, has been released and is available on Collibra’s Marketplace.
Spring Boot Integration Library - Collibra Marketplace
Java classes to facilitate access to Collibra APIs.
pratikmori
OP4 years ago · EditedThanks Team
springboot_team
·4 years ago · EditedHello Pratik,
A new version of the Spring Boot Integration Library should be released this week, while the Collibra instances will be upgraded later on.
Just to note that once the Spring Boot Integration Library is released, it should also work with instances having build number 20220302161146. Thank you
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
Thanks for letting us know, is there any ETA ?
Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
Just to keep you updated the a new version of the Collibra Integration Library will be released to address this issue when connecting with instances having build number 20220302161146.
Thank you
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
We have raise the ticket as per them it is a known issue,
Below response we got from them .
"A Workaround for the issue would be to use a cookie-based session.
When JSESSIONID cookie is set, then a csrfToken is returned."
Do you have any workaround available.
Thanks,
Pratik
pratikmori
OP4 years ago · EditedSure @spring-team.collibra.com , Will do as you suggested.
Thanks For guiding us
Really appreciate
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for checking.
Regarding the missing CSRF token as part of the login request, can you please open a support ticket with Collibra?
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
Please refer below screenshot. I can see
JSESSIONIDbut not CSRF Token and Response body as you mentioned it is {}.Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for the checking.
What needs to be confirmed is for the specified request (screenshot) what is returned as a response please?
That is, whether the response body contains a
{}or acsrfTokenkey with a non-empty value or something else.Additionally, whether the response headers contain a
JSESSIONIDcookie with a non-empty value.springboot_team
·4 years ago · EditedHello Pratik,
Thanks for the update.
The Collibra Integration Library internally makes use of the Collibra REST APIs to communicate with the instance. One of the first requests made is to login to the Collibra instance and retrieve a session ID and a CSRF token.
To confirm/check whether the instance is returning this information for this login request, would it be possible to test the cURL request in the previous post please? Thank you
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for the update.
The Collibra Integration Library internally makes use of the Collibra REST APIs to communicate with the instance. One of the first requests made is to login to the Collibra instance and retrieve a session ID and a CSRF token.
To confirm/check whether the instance is returning this information for this login request, would it be possible to test the cURL request in the previous post please? Thank you
pratikmori
OP4 years ago · EditedThanks @spring-team.collibra.com, I got what you are saying. I referred the another ticket which you mentioned in previous chat. i can see proper credentials in logs after enabling this flag collibra.log.http-requests-at-info=true
Refer below screenshot of logs:
what should i do now ?
Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for confirming this.
The issue could be that the response of the login request (HTTP POST /rest/2.0/auth/sessions) sent to the Collibra instance API does not contain the CSRF token. (Similar to this post.)
Since the error is a bit different, can you please check whether the response of the following cURL request is a
{}or whether it contains acsrfTokenkey? Thank youwhere:
<your_dgc_environment_url>should be replaced with the Collibra instance URL<user_name>should be replaced with the respective Collibra username<password>should be replaced with the respective Collibra passwordFor more information, you can also refer to: https://developer.collibra.com/developer-tutorials/rest-api-authentication/
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for confirming this.
The issue could be that the response of the login request (HTTP POST /rest/2.0/auth/sessions) sent to the Collibra instance API does not contain the CSRF token. (Similar to this post.)
Since the error is a bit different, can you please check whether the response of the following cURL request is a
{}or whether it contains acsrfTokenkey? Thank youwhere:
<your_dgc_environment_url>should be replaced with the Collibra instance URL<user_name>should be replaced with the respective Collibra username<password>should be replaced with the respective Collibra passwordFor more information, you can also refer to: https://developer.collibra.com/developer-tutorials/rest-api-authentication/
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
I am using collibra integration library 1.1.3. where when request go to the collibra platform for authenticating after that instead if below response
com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Successfully authenticated with the Collibra Platform.
We are getting below error in logs,
2022-03-09 20:41:43,254 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Authenticating with the Collibra Platform…
2022-03-09 20:41:46,152 [main] WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘entryPointController’ defined in file [C:\Users\pratikkumar.b.mori\3D Objects\Bo Connectivity new version\sbi-sap-bo-v1.0.1\sbi-sap-bo-1.0.1\target\classes\com\collibra\marketplace\sap\businessobjects\controller\EntryPointController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘collibraImportApiHelper’ defined in URL [jar:file:/C:/Users/pratikkumar.b.mori/.m2/repository/com/collibra/marketplace/collibra-integration-library/1.1.3/collibra-integration-library-1.1.3.jar!/com/collibra/marketplace/library/integration/CollibraImportApiHelper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘internalSharedLibraryConnection’: Invocation of init method failed; nested exception is com.collibra.marketplace.library.integration.exception.CollibraIntegrationLibraryException: {“message”:“An unexpected error occurred during execution.”,“details”:“Cannot invoke “com.fasterxml.jackson.databind.JsonNode.asText()” because the return value of “com.fasterxml.jackson.databind.JsonNode.get(String)” is null”}
2022-03-09 20:41:46,157 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
2022-03-09 20:41:46,173 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -
We are using SAP Business Objects to Collibra Integration where we have not used collibra Rest API.
Can you help to find what is the exact root cause since we are using Spring Boot Integration Library,
For more information you can refer below logs
Full logs :Full Logs.txt (24.9 KB)
Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
Regarding the error encountered, can you please check whether your Collibra instance version has build number 20220302161146?
Thank you
springboot_team
·4 years ago · EditedHello Pratik,
Regarding the error encountered, can you please check whether your Collibra instance version has build number 20220302161146?
Thank you
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com ,
Yes , I can see the same build number. Refer Below screenshot

Can you tell us what is the issue here and how we can resolve it.
Thanks,
Pratik
pratikmori
OP4 years ago · EditedThanks , It is working now
pratikmori
OP4 years ago · EditedThanks , It is working now
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
i am using Collibra integration library, few days back code is running fine but now it is throwing below error :org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘entryPointController’ defined in file [C:\Users\pratikkumar.b.mori\3D Objects\Bo Connectivity new version\sbi-sap-bo-v1.0.1\sbi-sap-bo-1.0.1\target\classes\com\collibra\marketplace\sap\businessobjects\controller\EntryPointController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘collibraImportApiHelper’ defined in URL [jar:file:/C:/Users/pratikkumar.b.mori/.m2/repository/com/collibra/marketplace/collibra-integration-library/1.1.3/collibra-integration-library-1.1.3.jar!/com/collibra/marketplace/library/integration/CollibraImportApiHelper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘internalSharedLibraryConnection’: Invocation of init method failed; nested exception is com.collibra.marketplace.library.integration.exception.CollibraIntegrationLibraryException: {“message”:“An unexpected error occurred during execution.”,“details”:“Cannot invoke “com.fasterxml.jackson.databind.JsonNode.asText()” because the return value of “com.fasterxml.jackson.databind.JsonNode.get(String)” is null”}
2022-03-09 20:41:46,157 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
2022-03-09 20:41:46,173 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -
Full logs : Full Logs.txt (24.9 KB)*
Can you please guide us what is the issue here
Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
The issue could be that when calling the findAssetByName method, the root community name is being passed instead of the name of the community that is the direct parent of the domain.
As an example, assuming the following structure:
When calling this method, the “Child Community” and “Domain” should be specified.
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com,
Thanks For Clarifying.
As of now i am using AssetImpl as= collibraCoreApiHelper.findAssetByName( assertFullname,DomainName,CommunityName)
but here i found one scenario where this method is not working . If we have one child community and inside the child community we have a domain then method is returning NULL response.
if i have only top level community and domain inside that community then this method is working fine. Do you have any idea why first scenario is failing ?
Thanks,
Pratik
springboot_team
·4 years ago · EditedHello Pratik,
To retrieve details of an asset using the CLI generated functions based on its resource ID, it can be achieved as follows (as specified in section “The Collibra CLI Generated Functions” of the documentation).
On the other hand to retrieve the details of all assets having type Report from a specific Collibra Platform instance domain, the export functionality should be used.
To do so, a TableViewConfig similar to the one attached can be used. (For more information on building the TableViewConfig, please refer to https://collibra-developer-portal.s3-eu-west-1.amazonaws.com/docs/output-module/Content/OutputModule/co_getting-started.htm ). Subsequently, the CollibraExportApiHelper may be used to submit the request to the Collibra Platform API (as specified in the documentation, section “The CollibraExportApiHelper Class”).
tvg-sample.txt (1.8 KB)
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for trying the Spring Boot Integration Library.
Assuming that the asset identifier (e.g. the asset full name) is known, this could be achieved by using the CollibraImportApiHelper class as specified in the library documentation section “A Step-by-Step Guide to Importing/Upserting Assets”, sub-section “The Asset Relations”.
Example:
If only one asset needs to be retrieved prior to adding the relation, this can be achieved through the CLI generated functions (section “The Collibra CLI Generated Functions”) or for multiple assets the export functionality of the Collibra Platform instance that exports assets based on a TableViewConfig (section “The CollibraExportApiHelper Class”) can be used.
springboot_team
·4 years ago · EditedHello Pratik,
Thanks for trying the Spring Boot Integration Library.
Assuming that the asset identifier (e.g. the asset full name) is known, this could be achieved by using the CollibraImportApiHelper class as specified in the library documentation section “A Step-by-Step Guide to Importing/Upserting Assets”, sub-section “The Asset Relations”.
Example:
If only one asset needs to be retrieved prior to adding the relation, this can be achieved through the CLI generated functions (section “The Collibra CLI Generated Functions”) or for multiple assets the export functionality of the Collibra Platform instance that exports assets based on a TableViewConfig (section “The CollibraExportApiHelper Class”) can be used.
pratikmori
OP4 years ago · EditedHi @spring-team.collibra.com.
Thanks for the information ,
Can you please also guide us about how to fetch the details for the Report Asset if my asset is present in Collibra . if you have any code snippet please provide
Thanks,
Pratik