Closed yustarandomname closed 3 years ago
Can you share your pom.xml
? I think that error means that you're not loading our Firestore autoconfiguration for some reason, may be missing a dependency.
Should look something like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Spring Cloud GCP Code Sample - Spring Data Firestore</name>
<artifactId>spring-cloud-gcp-data-firestore-sample</artifactId>
<!-- The Spring Cloud GCP BOM will manage spring-cloud-gcp version numbers for you. -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>1.2.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-data-firestore</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Please re-open if you're still having this issue.
Describe the bug When trying to init firestore template, IntelliJ reports "Could not autowire. no bean of type FirestoreTemplate found". Is there a simple way to resolve this bug?
Using: 'org.springframework.boot' version '2.3.5.RELEASE' "org.springframework.cloud:spring-cloud-gcp-data-firestore:1.2.6.RELEASE" "org.springframework.cloud:spring-cloud-gcp-starter-data-firestore:1.2.6.RELEASE"
Sample![Screenshot 2020-12-10 at 16 48 11](https://user-images.githubusercontent.com/25432790/101795226-f966b600-3b07-11eb-882b-db29a648efce.png)