Hi @Purnima Sahu , the error you are facing is because of assignment of Preferred location in below line of code.
defaultPolicy.setPreferredLocations(Lists.newArrayList("_"));
This code piece is needed only when we connect with Azure portal, but it is not needed in case of Azure Cosmos Db emulator. Could you please remove this code line and run the project again?
----------
If an Answer is helpful, please “Accept Answer” or Up-Vote for the same which might be beneficial to other community members reading this thread.