The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced fr
来源:互联网 发布:呼死你淘宝怎么找 编辑:程序博客网 时间:2024/05/21 20:41
The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced from required .class files
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); } }
2 Answers
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
May be you are missing org.springframework.beans-3.0.4.RELEASE jar
- The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced fr
- Maven项目报错:The type org.springframework.beans.BeansException cannot be resolved. It is indirectly ...
- The type org.junit.runners.BlockJUnit4ClassRunner cannot be resolved. It is indirectly referenced fr
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.apache.axiom.om.OMElement cannot be resolved. It is indirectly referenced from require
- thinkphp分页实现
- leetcode之Reverse Interger
- SQL CREATE INDEX 语句 高级教程
- 二叉搜索树
- memmove和memcpy
- The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced fr
- CSS中display对布局的影响以及元素display的默认值
- Android数据存储之SD卡
- springMvc跨域
- sax解析xml
- android之ViewPager
- 分享一些java学习网站网址
- Queue类
- SDUT 数据结构实验之栈六:下一较大值(二)