gpt4 book ai didi

How to fix: "Could not autowire. No beans of 'JdbcTemplate' type found" in spring-boot(修复方法:在Spring-Boot中“无法自动布线。找不到‘JdbcTemplate’类型的Bean”)

转载 作者:bug小助手 更新时间:2023-10-24 23:47:09 26 4
gpt4 key购买 nike



I followed the examples from SpringBoot Framework which starts here and got the next error when I tried to add the Spring bean

我遵循了SpringBoot框架中的示例,该框架从这里开始,当我尝试添加Spring Bean时得到下一个错误


Pom.xml

Pom.xml


    <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.222</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>


I try to make an insert into bd and bd doesn't change, The app itself works but doesn't connect the database, and JDBC is null.

我尝试插入到BD中,BD没有改变,应用程序本身可以工作,但没有连接数据库,并且JDBC为空。


更多回答

IDE not knowing all dependencies and configurations. Ignore it.

IDE不知道所有依赖项和配置。别理它。

优秀答案推荐
更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com