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. java-TheadPoolExecutor

    Executor的两极调度模型 第一级:java多线程程序把应用分解为若干个任务,然后使用用户级的调度器(Executor框架)将这些任务映射为固定数量的线程: 第二级:操作系统内核将这些线程映射到处 ...

  2. SSM集成

    SSM集成   Spring和各个框架的整合   Spring目前是JavaWeb开发中最终的框架,提供一站式服务,可以其他各个框架整合集成   Spring整合方案   SSH Ssh是早期的一种整 ...

  3. web&http协议&django初识

    1.什么是web应用 ​ Web应用程序是一种可以通过Web访问的应用程序,程序的最大好处是用户很容易访问应用程序,用户只需要有浏览器即可,不需要再安装其他软件. ​ 应用程序有两种模式C/S.B/S ...

  4. 【转载】在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support

    在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone config ...

  5. Entity Framewrok Migration 重置

    转载自:https://weblog.west-wind.com/posts/2016/jan/13/resetting-entity-framework-migrations-to-a-clean- ...

  6. DataGridView绑定数据、删除数据

    定义学生类: using System; using System.Collections.Generic; using System.Linq; using System.Text; using S ...

  7. vue-cli || webpack 打包的时候css里面写的背景图片的路径出错问题

    .bg width 100% position fixed left 0 top 0 height 100vh z-index -1 background url('~@/assets/imgs/bg ...

  8. 五、HashMap的使用 及其源码解析

    HashMap的底层实现原理?领接表(数组+链表)hash表数组+链表+红黑树 链表:查找慢 插入 删除快红黑树:查找快 插入 删除慢 HashMap是线程安全的吗?不是线程安全的 在什么情况下 ,是 ...

  9. ionic 局部刷新

    $scope.$on('$ionicView.beforeEnter', console.log("刷新"); })

  10. B+树Java代码实现以及测试

    M阶B+树的定义: 任意非叶子结点最多有M个子节点:且M>2: 除根结点以外的非叶子结点至少有 M/2个子节点: 根结点至少有2个子节点: 除根节点外每个结点存放至少M/2和至多M个关键字:(至 ...