azure-sdk-for-java: Getting "resource" is null with Spring Data REST and azure-spring-data-cosmos
Hi
I am trying to use azure-spring-data-cosmos with Spring Boot Starter Data REST, but encountering the following error on Spring Boot app’s startup:
Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.data.rest.core.mapping.ResourceMetadata.isExported()" because "resource" is null
Dependencies in pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>3.31.0</version>
</dependency>
Environment JDK 17 - java version “17.0.5” 2022-10-18 LTS Java™ SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot™ 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing) Windows 10 x64
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (10 by maintainers)
@backwind1233 Thanks for reproducing the error. As per your suggestion, I have removed SpringFox from the deps but the issue is still coming:
The web app starts and on hitting the API (GET) it gives 500 status code
Attaching new project without SpringFox - SpringDataRESTNoSpringFox.zip
@backwind1233 could you please follow up?