我的异常网 Java Web开发 Java 面试 J2ME J2EE Java相关 Eclipse J2SE .NET分析设计 .NET Framework .NET面试 .NET组件控件 VC J# Delphi .NET报表 C# ASP LINQ .NET新技术 VB Web Service .NET相关 Oracle面试 Oracle认证考试 Oracle管理 Oracle开发 Oracle技术 Java Exception DotNet Exception Oracle Exception
  

错误:Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]

我用struts1.1+spring2.0+hibernate3.0+ehcache1.3在没有配置ehcache前,都没有问题,程序能正常运行,但加上ehcache的配置后,启动tomcat就报错:

2008-05-07 03:02:33 StandardContext[/testhbn]action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:651)

不知道是什么原因?
------解决方法--------------------------------------------------------
看着像
<value>com/suntravel/sunes/user/User.hbm.xml </value>
有问题,User.hbm.xml文件没什么问题吧
------解决方法--------------------------------------------------------
可能是包冲突问题,把hibernate-annotations.jar删掉试试看?
------解决方法--------------------------------------------------------
同意包冲突

看看 asm.jar asm-attrs.jar cglib-2.1.3.jar commons-cllections-2.1.1.jar 是否有重复的包, 如果有删除上述重复的
------解决方法--------------------------------------------------------
刚遇到了这问题。我想也是包冲突的问题。删包试试看
 

    
    
如异常没有得到解决,请继续查看以下解决方法:
热点异常解决方法
最新异常解决方法
随机异常解决方法