I've created a simple Java project in eclipse. And added the JARs to the classpath. In the file BulkImport.java, I'm trying to connect to the Azure Cosmos DB. However, I'm running into the following error.
Warning : [main] WARN com.microsoft.azure.documentdb.GlobalEndpointManager - Failed to retrieve database account information. com.microsoft.azure.documentdb.DocumentClientException: java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
The error occurs at this line :
DocumentClient client = new DocumentClient(ENDPOINT, PRIMARY_KEY, connectionPolicy, ConsistencyLevel.Session);
The Endpoint looks like this : "https://xxxx.documents.azure.com:443"
Later on instead of this endpoint, I directly gave,"https://IPAddress:443".
So I got the following error.
BulkImport.java.txt
I'm facing an issue here.
I've created a simple Java project in eclipse. And added the JARs to the classpath. In the file BulkImport.java, I'm trying to connect to the Azure Cosmos DB. However, I'm running into the following error.
The error occurs at this line :
DocumentClient client = new DocumentClient(ENDPOINT, PRIMARY_KEY, connectionPolicy, ConsistencyLevel.Session);
The Endpoint looks like this :"https://xxxx.documents.azure.com:443"
Later on instead of this endpoint, I directly gave,
"https://IPAddress:443"
. So I got the following error.I've attached the code file. Please help me understand the issue.
@moderakh