Error creating bean with name 'jobCheckLost'defined in class path resource [applicationContext.xml]

来源:百度知道 编辑:UC知道 时间:2024/05/17 09:53:23
测试文件这样写的import org.jb.common.dao.hibimpl.CommonDAOHibImpl;
import org.jb.ym.entity.SysUser;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
ApplicationContext context=new FileSystemXmlApplicationContext("classpath:/applicationContext.xml");
SysUser user=new SysUser();
user.setUsrName("aa");
user.setUsrPassword("aa");
user.setUsrFlag(1);
CommonDAOHibImpl commonDAO=(CommonDAOHibImpl)context.getBean("commonDAO");
commonDAO.add(user);
}
}
出现错误
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobCheckLost' defined in class path resource [applicationContext.xml]: Invocation of init method f

异常:org.apache.commons.collections.SetUtils.orderedSet

看来是创建jobCheckLost的时候缺个collections的公用包

导一个进去就行了
----------------------
缺少collections包
在这个地址下载:
http://commons.apache.org/downloads/download_collections.cgi