首先,我没有使用 Maven,因为 Maven 插件没有安装到我的 Eclipse 中。它抛出 502 异常代码。然后我尝试创建一个动态Web项目并在lib下添加了spring jar(Context,Core,Webmvc)并配置为构建路径。
然后我创建了一个 Config 类,但它抛出
The type org.springframework.beans.factory.support.BeanNameGenerator cannot be resolved. It is indirectly referenced from required .class files
我用谷歌搜索了它,但每个人都指的是有 spring 上下文 jar。还可能缺少什么?
我的简单代码
package com.sbf.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "com.sbf.spring")
public class AppConfig {
}
最佳答案
它位于 spring-beans
jar 中。尝试将其也添加到您的依赖项中
关于java - 如果没有 Maven,则无法解析 org.springframework.beans.factory.support.BeanNameGenerator 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46068576/