为什么我需要包含spring-context
在我的新spring boot
项目中才能工作?
我有这个在我的pom.xml
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
我可以在 spring-web 依赖项中看到依赖项 spring-context
如果我从 pom.xml 中删除 spring-context,则应用程序不会运行。
以下是我得到的错误:
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nameOfController'