The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced fr

整合SSM遇到org.springframework.beans.factory.BeanInitializationException 开始它并没有报个错误,如果早点报出来也不至于找了两三天,搞得我苦不堪言,后面我发现~~,就是在Spring导入数据库配置文件和mybatis核心配置文件的时候都忘记了加上classpath,最后想说大家在开发的过程中务必多注意细节~ 阅读详情

Hi am facing issue with below error in eclipse please help to resolve this issue.

Error message

The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced from required .class files

I imported the jar file (org.springframework.context-3.0.4.RELEASE) even then am facing this issue.

see below code( where am getting issue at line ApplicationContext appCtx = new ClassPathXmlApplicationContext("applicationContext.xml");)

    package com.csp.test.document;

    import static org.junit.Assert.*;
    import org.junit.Test;
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    import com.csp.model.Document;
    import com.csp.service.DocumentService;

    public class DocumentTest {

        @Test
        public void testGetDocument() {
            ApplicationContext appCtx = new ClassPathXmlApplicationContext(
                    "applicationContext.xml");

            DocumentService documentService = (DocumentService) appCtx
                    .getBean("documentService");

            Document doc = documentService.getDocument(1);

            String status = null;

            if (doc != null) {
                status = documentService.saveDocument(doc);
            } else {
                System.out.println("error in retreiving document");
            }

            assertEquals("Success Status", "SUCCESS", status);

        }

    }
share improve this question
 

2 Answers

up vote 4 down vote accepted

If you aren't using maven (or any other dependency management tool, for that matter), you should addspring-context dependencies manually, which are spring-beans, spring-core, spring-aop and spring-expression, of course each of them have their own dependencies either (Transitive Dependency). By the way, BeansException is part of spring-beans module

share improve this answer
 
1 
Thank you :) as you said I have download (spring-beans-3.1.xsd download) jar and its worked for me...... –  ela0250  Dec 11 '14 at 15:18
 
Your welocome. for better dependency management, i recommend to use maven –  Ali Dehghani  Dec 11 '14 at 15:35

May be you are missing org.springframework.beans-3.0.4.RELEASE jar

share improve this answer
新建springBoot项目提示:The type org.springframework.context.ConfigurableApplicationContext cannot be resol 场景 在Eclipse中新建SpringBoot项目后提示: 解决 关掉Eclipse 进入到项目所在目录。 在此目录下打开cmd,windows下是按住shift,然后点击鼠标右键,选择在此处打开命令行窗口。 然后输入: mvn dependency:purge-local-repository 成功后 重启Eclipse之后,不报错了。 ... 阅读详情

相关推荐

人工势场法在自动驾驶避障中的实践与优化

本文深入探讨了人工势场法在自动驾驶避障中的核心原理与实践优化。通过解析引力与斥力模型,揭示了经典算法在局部最优和目标不可达等问题上的局限性,并重点介绍了改进斥力场函数、引入道路边界斥力及动态参数调整等关键优化策略,有效提升了该局部路径规划算法在复杂动态场景下的实用性与鲁棒性。

weixin_29208327的博客 927

Maven项目报错:The type org.springframework.beans.BeansException cannot be resolved. It is indirectly ...

一、问题描述 在Main中使用ClassPathXmlApplicationContext启动spring,提示: The constructor ClassPathXmlApplicationContext(String) refers to the missing type BeansException The type org.springframework.beans

fendo 1万+

【CV论文精读】【协同感知综述】Collaborative Perception for Autonomous Driving :Current Status and Future Trend

感知是自动驾驶系统的关键模块之一,近年来取得了很大进展。然而,单个车辆的有限能力导致感知性能提高的瓶颈。为了突破个体感知的局限,协作感知被提出,它使车辆能够共享信息来感知视线和视野之外的环境。本文综述了有前途的协作感知技术的相关工作,包括介绍了基本概念,概括了协作模式,总结了协作感知的关键要素和应用。最后,我们讨论了这一研究领域面临的挑战和问题,并给出了一些潜在的进一步方向。

weixin_44184852的博客 4690

The import org.springframework cannot be resolved 相关问题

使用eclipse导入本地一个java项目时遇到了相关问题,首先是:The import org.springframework cannot be resolved;解决方法: maven项目: 在maven中的pom.xml文件中添加代码所示的第二个依赖项spring-test即可,添加后右键项目->Maven->Update Project就完成。 <de...

crazywsp的博客 4万+

利用Python实现纬度加权平均(即NCL中的wgt_areaave)

当处理全球数据的时候,最常见的分析就是全球、北半球平均了,这时候一定要注意要根据纬度等信息进行加权,求加权平均,要不然结果肯定会不准。但是对于Python中,常规的计算包里面是没有的,或许现在有其他包可以实现,也可以告诉我~。

记录基于python语言处理气象问题的一些代码,包括不限于气象数据读取、机器学习和深度学习建模。 5745

深入GD32/STM32引脚复用:你的JTAG/SWD接口是怎么‘消失’的?一次讲清原理与预防

本文深入解析GD32/STM32调试接口(JTAG/SWD)突然失效的原理与预防措施。通过分析MCU启动流程、引脚复用机制及典型错误代码模式,揭示调试接口'消失'的根本原因,并提供硬件设计检查清单、软件防护代码及开发流程优化方案,帮助开发者有效避免烧录失败问题。

weixin_42532938的博客 369

the type org.springframework.dao.support.daosuppor

I am using only the 3rd party bundles from the revision 6343, spring-osgi-core, spring-osgi-extender, io and mock are from revision 6170. (I've got compilation errors on the new version)... anyway:The...

梦醒2010 289

2024.12.29 【RNA-seq】Rawdata数据缺失问题与解决方案

Fastq格式是一种用于存储高通量测序数据的文件格式,包含序列和相应的质量信息。第一行以开头,后接序列标识符;第二行是测序的DNA序列;第三行以开头,可能会跟随序列标识符;第四行是对应的质量值,以ASCII字符表示。Rawdata的数据完整性通常情况下是没有问题的,但我们仍然需要对下机数据进行验证,确保后续分析的正常进行,好的分析习惯可以提高整体的分析效率,避免很多不必要的麻烦。

1112

解决org.springframework.beans.factory.BeanInitializationException: Could not load properties问题

解决org.springframework.beans.factory.BeanInitializationException: Could not load properties问题

qq_45754346的博客 2451

RK3566/RK3568 Android 11添加系统服务

【代码】RK3566/RK3568 Android 11添加系统服务。

qq_23921815的博客 641

# YOLOv11-seg改进系列 | 引入CVPR MetaFormer的C3k2_PoolingFormerCGLU模块,池化Token混合+CGLU门控MLP

本文引入 CVPR 2022 论文(MetaFormer/PoolFormer)提出的 MetaFormer 元架构设计,以Pooling Token 混合器 + ConvolutionalGLU(CGLU)MLP构成,将其封装为,用于替换 YOLOv11-seg 的 C3k2 块。对比维度C3k2(基线)C3k2_PoolingFormerCGLU(本文)参数量(n scale)2.46M≈2.49M9.6≈9.69.7(+1.0%)架构范式单阶段卷积MetaFormer 双阶段。

qq_44224801的博客 845

找不到org.springframework.beans.factory.InitializingBean的类文件

找不到org.springframework.beans.factory.InitializingBean的类文件 最近想重新运行一下自己的javaweb代码发现了这个问题,可能之前不小心删了某个包 解决方法: 添加spring.beans.××××的jar包,版本要与spring.core.××××,spring.context.××××一致 ...

weixin_45579788的博客 2665

整车的智能配电系统

本文探讨了汽车电网安全的重要性,分析了传统汽车电网的现状,并重点介绍了半导体在汽车智能配电系统中的作用。半导体凭借其单向导电性和可控性,如二极管、MOSFET等,提供了更高效、安全的电力控制。通过对比传统保险丝与半导体器件,阐述了半导体在过流保护、电压监测和故障诊断方面的优势,强调其在减少安全隐患、提高能源管理和续航里程方面的贡献。极氪智能配电系统展示了如何运用半导体技术实现整车能源的精细化管理,降低维修成本,减少线束复杂性,提升安全性能。

让你爱上电路设计 1612

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxx --- 采坑

今天搞了一下 springmvc + mybatis 项目:出现了如下错误 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.fa...

qq_41497111的博客 354

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

maven报错:The import org.springframework cannot be resolved

从svn上拉出maven工程后,各个子工程出现jar包依赖问题,The import org.springframework cannot be resolved,具体情况如下图所示。 解决方法是打开子工程的目录,用DOS命令进入到该工程下,依次执行mvn clean,mvn install,mvn eclipse:eclipse等命令,等jar包下载完成之后,再refresh子工程,错误提...

qq_29378537的博客 2076

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

出现 org.springframework.beans.factory.BeanCreationException 异常的原因及解决方法

springcloudalibaba集成seata启动报错: 错误信息如下: E:\app\Java\jdk1.8.0_172\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:49385,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxrem

weixin_47384874的博客 1万+

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

程序启动报错org.springframework.beans.factory.support.BeanDefinitionOverrideException(实例冲突)

程序启动报错org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with

weixin_52116015的博客 4658

整合Spring和Struts时org.springframework.beans.factory.CannotLoadBeanClassException解决办法

在整合Spring和Struts时碰到了这个警告:org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.test.service.impl.MyServiceImpl] for bean with name 'myService' defined in ServletContex...

yiguang_820的博客 5863

解析和解决org.springframework.beans.factory.NoSuchBeanDefinitionException异常

NoSuchBeanDefinitionException异常是Spring框架中常见的异常之一,对于开发人员来说是一个重要的问题。了解异常的产生原因和解决方案,可以帮助我们更好地处理和解决异常。本文介绍了多种解决NoSuchBeanDefinitionException异常的方法,包括检查bean的命名和注解、检查bean的配置文件、检查bean的作用域、检查bean的依赖关系等。

博客 6627

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sateState':

十一月 22, 2019 10:50:18 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:de...

wqqGo的博客 299

spring_“The type XXX cannot be resolved. It is indirectly referenced from required .class files错误“

Maven工程,使用独立的 lib包。

weixin_45828554的博客 462

已解决org.springframework.amqp.AmqpException: No method found: AMQP异常的正确解决方法,亲测有效!!!

已解决org.springframework.amqp.AmqpException: No method found: AMQP异常的正确解决方法,亲测有效!!!

小明的Java问道之路 1855

聊聊Spring的bean覆盖(存在同名name/id问题),介绍Spring名称生成策略接口BeanNameGenerator【享学Spring】

每篇一句 知其然,知其所以然才应该是做学问的态度。在应用时可以忽略非常多的实现细节,但在做学问时要吹毛求疵而不要放过任何一个细节 前言 众所周知,Spring容器可以简单粗暴的把它理解为一个大大的Map,存储着容器所管理的所有的单实例对象。我们从使用...

Chen4852010的博客 3127

注入 bean 失败 org.springframework.beans.factory.BeanCreationException 异常

启动 Tomcat 服务器,报出如下错误 出现 org.springframework.beans.factory.BeanCreationException 异常 通过观察上图中被标记出来的异常信息,可以知道 org.springframework.beans.factory.BeanCreationException: Error creating bean with name...

学英语的程序员 3968

org.springframework.amqp.AmqpIOException: java.io.IOException错误的正确解决办法,亲测有效,嘿嘿嘿

org.springframework.amqp.AmqpIOException: java.io.IOException 错误通常表示在使用 Spring AMQP(Advanced Message Queuing Protocol)进行消息通信时,底层通信发生了 I/O 异常。这可能是由于网络问题、连接问题、序列化/反序列化问题或其他底层通信错误导致的。 问题分析 当遇到 AmqpIOException 时,通常说明在尝试读取或写入 AMQP 消息时,底层的 I/O 操作失败。可能的原因包括但不限于:

PythonAigc的博客 3441
上一篇: Spring3系列10- Spring AOP——Pointcut,Advisor拦截指定方法
下一篇: [Eclipse] The type XXX cannot be resolved. It is indirectly referenced from required .class files错误.
javaPie
博客等级 码龄16年 1171粉丝 43原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值