Closed jdubois closed 5 years ago
Interestingly, the method createContainerIfNotExists(CosmosContainerProperties containerSettings, int throughput)
(which is just the same but with the thoughput added) doesn't have the issue, so just setting the throughput fixes the issue for me.
I'll propose a patch, as this is really simple.
I probably caused this bug when I was fixing up the overloads for some things to not require request options.
@mbhaskar - can you check if this is fixed yet? He has a PR out that fixes it that we can port to the new repo if not. If we have fixed it, please close this issue.
This is fixed.
Describe the bug I have a null pointer exception when doing
database.createContainerIfNotExists(new CosmosContainerProperties(CONTAINER_NAME, "/partition"))
In fact this method calls this line: https://github.com/Azure/azure-cosmosdb-java/blob/v3/sdk/src/main/java/com/azure/data/cosmos/CosmosDatabase.java#L250
Which uses a
null
value for the classCosmosContainerRequestOptions
.So when this line is called for creating a container: https://github.com/Azure/azure-cosmosdb-java/blob/v3/sdk/src/main/java/com/azure/data/cosmos/CosmosDatabase.java#L177 it does a
options.toRequestOptions()
which fails as the object is null.Environment summary SDK Version: 3.0.0 Java JDK version: openjdk version "11.0.3" 2019-04-16 OS Version (e.g. Windows, Linux, MacOSX): MacOSX