I am getting an error when using the airbyte java ...
# ask-ai
j
I am getting an error when using the airbyte java sdk to retrieve all configured sources. I am using the sample code provided by the sdk. Airbyte version: 1.0.0 SDK version 1.5.9 Am I doing something wring or is there a problem with the SDK?
Copy code
<code>
Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            ListSourcesRequest req = ListSourcesRequest.builder()
                .build();

            ListSourcesResponse res = sdk.sources().listSources()
                .request(req)
                .call();
</code>
Copy code
<error_message>
Method threw 'com.fasterxml.jackson.databind.JsonMappingException' exception.
</error_message>
Copy code
<detail_message>
json matched more than one of the possible type references, matches are: [com.airbyte.api.models.shared.SourceAirtable, com.airbyte.api.models.shared.SourceAppfollow, com.airbyte.api.models.shared.SourceAsana, com.airbyte.api.models.shared.SourceClickhouse, com.airbyte.api.models.shared.SourceDynamodb, com.airbyte.api.models.shared.SourceE2eTestCloud, com.airbyte.api.models.shared.SourceFaker, com.airbyte.api.models.shared.SourceGoogleDirectory, com.airbyte.api.models.shared.SourceHardcodedRecords, com.airbyte.api.models.shared.SourceInsightly, com.airbyte.api.models.shared.SourceIp2whois, com.airbyte.api.models.shared.SourceMailchimp, com.airbyte.api.models.shared.SourceMonday, com.airbyte.api.models.shared.SourceNotion, com.airbyte.api.models.shared.SourceOkta, com.airbyte.api.models.shared.SourcePinterest, com.airbyte.api.models.shared.SourcePostgres, com.airbyte.api.models.shared.SourceRetently, com.airbyte.api.models.shared.SourceScryfall, com.airbyte.api.models.shared.SourceSpacexApi, com.airbyte.api.models.shared.SourceSquare, com.airbyte.api.models.shared.SourceTiktokMarketing, com.airbyte.api.models.shared.SourceWhiskyHunter, com.airbyte.api.models.shared.SourceXkcd, com.airbyte.api.models.shared.SourceYoutubeAnalytics] - json=REDACTED
</detail_message>
u
Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information about the Airbyte Java SDK or the error you're encountering. However, based on the error message, it seems like there might be an issue with the JSON mapping in your code. The error message suggests that the JSON data matches more than one of the possible type references, which could be causing the
JsonMappingException
. I would recommend checking the structure of your JSON data and ensuring it matches the expected format. Also, make sure that the versions of Airbyte and the SDK you're using are compatible. For more detailed help, you might want to check out [Airbyte’s error-messages documentation](https://reference.airbyte.com/reference/errors) or post your question on the [Airbyte discussion forum](https://discuss.airbyte.io/).