Error with java sdk

Amol Harde 25 Reputation points
2023-09-27T12:11:32.1+00:00

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 **[default-nioEventLoopGroup-1-3]** ERROR c.a.a.f.d.i.util.Utility - 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>


Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,541 questions
{count} votes