1、第一个这种类型的异常

1.1、异常信息:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/beans_common.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager

错误/异常描述:sessionFactory 初始化失败。

说明:我用的是SSH框架。JDK-1.8;Tomcat-7.0.96

我用到的jar包:

    

1.2、解决方法  

我 出现在这个问题的原因是:jar包的问题(应该是冲突),我删除了hibernate-core-4.1.12.Final.jar这个jar包,问题就解决了。

其他原因:

1、保证jar包没有问题的情况下,还出现这个问题,那么就是你的Spring配置文件配置错了,请仔细检查,改回来即可。

2、保证jar包没有问题,Spring配置文件也没有问题的情况下,还出现这个问题,那么就在Spring配置文件中的头文件,链接后面加上default-autowire="byName" 即可。如果还解决不了,那就看下面“2、第二个这种类型的异常 ” 虽然这两个异常相似,实质,还是不同的。

2、第二个这种类型的异常

2.1、异常信息:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [spring/beans_common.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory

错误/异常描述:nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory;sessionFactory 初始化失败,无法获得默认的Bean验证工厂。

说明:我用的是SSH框架。JDK-1.8;Tomcat-7.0.96

我用到的jar包:

    

2.2、解决方法 

说明:

<prop key="javax.persistence.validation.mode">none</prop>

javax.persistence.validation.mode 默认情况下是auto(自动),就是说,如果不设置的话,它会自动去你的classpath下面找一个bean-validation**包,但是找不到,所以beanvalitionFactory错误。

原创作者:DSHORE

作者主页:http://www.cnblogs.com/dshore123/

原文出自:https://www.cnblogs.com/dshore123/p/11874754.html

欢迎转载,转载务必说明出处。(如果本文对您有帮助,可以点击一下右下角的 推荐,或评论,谢谢!)

错误/异常:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/beans_common.xml]...的解决方法的更多相关文章

  1. 异常将上下文初始化事件发送到类的侦听器实例.[org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class p

    严重: 异常将上下文初始化事件发送到类的侦听器实例.[org.springframework.web.context.ContextLoaderListener]org.springframework ...

  2. aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai

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

  3. 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]

    报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...

  4. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is

    在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...

  5. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [spring/applicationContext-service.xml]: Cannot resolve refer

    <!-- aop --> <aop:config> <aop:pointcut expression="execution(* com.zsn.Service. ...

  6. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cardSalDao' defined in file [E:\GItUp\pointerCard+redis\target\gameCard-1.0-SNAPSHOT\WEB-INF\classes\cn\jbit\dao

    错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cardSa ...

  7. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bireportSqlSessionFactory' defined in URL

    报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birepo ...

  8. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

    spring boot web项目运行时提示如下错误 org.springframework.beans.factory.BeanCreationException: Error creating b ...

  9. 【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource

    环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.s ...

随机推荐

  1. Idea中一个服务按多个端口同时启动

    1.勾选并行启动 2.-Dserver.port=9018

  2. (转)js-分享功能(qq,微信,微博)

    //1 分享QQ好友 function qq(title,url,pic)     {         var p = {             url: 'http://test.qicheyit ...

  3. 深度挖坑:从数据角度看人脸识别中Feature Normalization,Weight Normalization以及Triplet的作用

    深度挖坑:从数据角度看人脸识别中Feature Normalization,Weight Normalization以及Triplet的作用 周翼南 北京大学 工学硕士 373 人赞同了该文章 基于深 ...

  4. C# DataTable和List转换操作类

    using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.R ...

  5. 多节点bigchaindb集群部署

    文章比较的长,安装下来大概4个小时左右,我个人使用的服务器,速度会快一点. 安装环境 ostname ip os node-admin 192.168.237.130 ubuntu 18.04.2 d ...

  6. 解决https 请求过程中SSL问题

    最近一个项目中用到了https的请求,在实际调用过程中发现之前的http方法不支持https,调用一直报错. 查询了一下,添加几行代码解决问题. public string HttpPost(stri ...

  7. 【原创】大叔经验分享(85)ssh秘钥之创建和使用

    一 创建秘钥 1 Macbook $ ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to sa ...

  8. cmd查找端口占用情况

    查找端口占用情况:netstat -ano|findstr 4848 查看使用指定端口的应用程序:tasklist|findstr xxxx,xxxx指的是pid 结束指定进程:taskkill /p ...

  9. 南宁AI项目

    1.能了解并对项目整体进度情况有清晰的认识,什么时间点需要完成什么工作项. 2.认识了解项目干系人,能和客户独立沟通交流,理解现场业务,不要一问三不知,什么情况都不了. 3.能推动项目进展和问题及时处 ...

  10. springboot启动流程(九)ioc依赖注入

    所有文章 https://www.cnblogs.com/lay2017/p/11478237.html 正文 在前面的几篇文章中,我们多次提到这么一个转化过程: Bean配置 --> Bean ...