Java 无法解析类型org.springframework.beans.BeansException。它是从必需的.class文件间接引用的

Java 无法解析类型org.springframework.beans.BeansException。它是从必需的.class文件间接引用的,java,javascript,eclipse,spring,swing,Java,Javascript,Eclipse,Spring,Swing,您好,我在eclipse中遇到以下错误,请帮助解决此问题 错误消息 无法解析类型org.springframework.beans.BeansException。它是从必需的.class文件中间接引用的 我导入了jar文件(org.springframework.context-3.0.4.RELEASE),即使当时我面临这个问题 请参见下面的代码(其中,我在ApplicationContext appCtx=new ClassPathXmlApplicationContext(“Applica

您好,我在eclipse中遇到以下错误,请帮助解决此问题

错误消息

无法解析类型org.springframework.beans.BeansException。它是从必需的.class文件中间接引用的

我导入了jar文件(org.springframework.context-3.0.4.RELEASE),即使当时我面临这个问题

请参见下面的代码(其中,我在ApplicationContext appCtx=new ClassPathXmlApplicationContext(“ApplicationContext.xml”);一行遇到问题)


可能您缺少org.springframework.beans-3.0.4.RELEASE jar

如果您没有使用maven(或任何其他依赖项管理工具),您应该手动添加
spring上下文
依赖项,这些依赖项是
springbean
springcore
springaop
springexpression
,当然它们也都有自己的依赖项(传递依赖项)。顺便说一下,
BeansException
springbeans
模块的一部分

是的,我已经设法解决了这个问题。。。。我使用以下模式:程序和结果没有错误

版本: 3.0.4.1发布

然后选择->Maven->更新项目

我对*org.springframework.context.EnvironmentAware有问题*
I have problems with *org.springframework.context.EnvironmentAware*
Adding this dependency in pom from maven repository solve my problem.

*<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>5.0.3.RELEASE</version>
</dependency>*
从maven存储库在pom中添加此依赖项可以解决我的问题。 * org.springframework 春豆 5.0.3.发布 *
发生错误是因为缺少SpringBeans依赖项。如果您使用的是Maven,请将SpringBeans依赖项添加到您的pom.xml文件中

例如:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-beans</artifactId>
  <version>5.3.5</version>
</dependency>

org.springframework

谢谢:)正如你所说,我已经下载了(spring-beans-3.1.xsd下载)jar,它对我有用……你的欢迎。为了更好地管理依赖关系,我建议使用Maveni如果您是maven用户,然后升级您的版本>=4.0.0好的,现在我看到当出现此异常时,您能否给出确切的原因,如调用
BeansException
欢迎使用StackOverflow!环顾四周,这是英语网站。现在,我已经用英语翻译了这篇文章。请用英语发布您的问题、答案和评论!此jar需要存在于依赖项中。此jar需要存在于依赖项中。
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-beans</artifactId>
  <version>5.3.5</version>
</dependency>