Error with java sdk
Amol Harde
25
Reputation points
Hi All,
We have used Java SDK and following code but the code getting error
final String endpoint = "";
final String key = "";
DocumentAnalysisClient client = new DocumentAnalysisClientBuilder().credential(new AzureKeyCredential(key))
.endpoint(endpoint).buildClient();
byte[] fileContent = model.getFileData(); //here get file data of file
SyncPoller<OperationResult, AnalyzeResult> analyzeDocumentPoller = client
.beginAnalyzeDocument(modelId, BinaryData.fromBytes(fileContent));
AnalyzeResult analyzeResult = analyzeDocumentPoller.getFinalResult();
error is
17:34:54.829[0;39m **[1;30m[default-nioEventLoopGroup-1-3]**[0;39m [1;31mERROR[0;39m [35mc.a.a.f.d.i.util.Utility[0;39m - Failed to parse operation header for result Id from: null
com.Anemoi.InvestorRelation.DataIngestion.DataIngestionDaoException: Failed to parse operation header for result Id from: null
dependency used
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-formrecognizer</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.37.0</version>
</dependency>