# Spring 项目运行提示错误 Not a managed type

**URL:** <https://www.isharkfly.com/t/spring-not-a-managed-type/14368>\
**Category:** 程序语言\
**Tags:** java, spring\
**Created:** [March 31, 2023, 5:09pm UTC](https://www.isharkfly.com/t/spring-not-a-managed-type/14368 "2023-03-31T17:09:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 31, 2023, 5:09pm UTC](https://www.isharkfly.com/t/spring-not-a-managed-type/14368/1 "2023-03-31T17:09:46Z")

</div>

在启动 Spring 项目的时候提示下面的错误信息。

 ![2023-03-31_13-06-03](https://com-ossez-www-discourse.s3.dualstack.us-east-2.amazonaws.com/discourse-uploads/original/2X/2/2e4ba13b25330525fd48e914eed51224d23cd4b8.png)

## 问题和原因

这个问题的原因是你的类没有在 Spring 管理的容器中注册。

主要原因是上面的包的路径不正确。

![2023-03-31_13-07-48](https://www.isharkfly.com/images/transparent.png)

修改上面的包的路径后重启服务就可以解决启动的时候对象没有注册的问题。
