Spring Boot 启动时出现错误:'java.lang.TypeNotPresentException: Type [unknown] not present',这通常是因为缺少类 'org.springframework.dao.support.DaoSupport' 导致的。

可能的原因有:

  1. 依赖没有正确引入:检查项目的依赖是否正确引入,确保 'spring-jdbc' 或 'spring-tx' 等依赖已包含在项目中。
  2. 版本不匹配:尝试更新相关的依赖版本,确保它们与 Spring Boot 版本兼容。
  3. Maven 或 Gradle 缓存问题:尝试清除 Maven 或 Gradle 的缓存,再重新构建项目。

解决方法:

  1. 在项目的 pom.xml 或 build.gradle 文件中检查依赖是否正确引入,并确保 'spring-jdbc' 或 'spring-tx' 等依赖已包含在项目中。
  2. 更新相关的依赖版本,例如在 pom.xml 文件中将 'spring-jdbc' 依赖更新到最新版本:
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>6.0.6</version>
</dependency>
  1. 清除 Maven 或 Gradle 的缓存,然后重新构建项目。

如果问题仍然存在,请查看项目的依赖树,并尝试使用排除或更新依赖来解决冲突。

Spring Boot 启动错误:java.lang.TypeNotPresentException: Type [unknown] not present

原文地址: https://www.cveoy.top/t/topic/lAxW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录