No Hibernate Session bound to thread
来源:互联网 发布:淘宝服务器时间同步 编辑:程序博客网 时间:2024/05/16 17:43
org.quartz.SchedulerException: JobListener 'GLOBAL_LISTENER' threw exception: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here [See nested exception: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here]
at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1995)
at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:381)
at org.quartz.core.JobRunShell.run(JobRunShell.java:247)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
at com.g360.dao.GenericDaoHibernate.findByAttribute(GenericDaoHibernate.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at com.sun.proxy.$Proxy28.findByAttribute(Unknown Source)
at com.g360.schedule.G360JobListener.jobWasExecuted(G360JobListener.java:66)
at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1995)
at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:381)
at org.quartz.core.JobRunShell.run(JobRunShell.java:247)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
at com.g360.dao.GenericDaoHibernate.findByAttribute(GenericDaoHibernate.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at com.sun.proxy.$Proxy28.findByAttribute(Unknown Source)
at com.g360.schedule.G360JobListener.jobWasExecuted(G360JobListener.java:66)
at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1993)
执行定时任务时,报上述异常:
解决办法:
上述红色字体部分,方法定义处加上:@Transactional
关于@Transactional,参考下面的论坛:
http://stackoverflow.com/questions/1079114/spring-transactional-annotation-best-practice
解决此bug参考论坛:
http://stackoverflow.com/questions/4961636/no-hibernate-session-bound-to-thread-and-configuration-does-not-allow-creation
0 0
- No Hibernate Session bound to thread
- No Hibernate Session bound to thread
- HibernateException: No Hibernate Session bound to thread
- springmvc No Hibernate Session bound to thread
- HibernateException: No Hibernate Session bound to thread
- No Hibernate Session bound to thread、No Session found f
- hibernate的session的No Hibernate Session bound to thread
- spring hibernate No Hibernate Session bound to thread异常
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- No Hibernate Session bound to thread纠结了很久
- 异常:No Hibernate Session bound to thread……
- No Hibernate Session bound to thread, and configuration
- No Hibernate Session boundNo Hibernate Session bound to thread, and configuration does not allow cr
- 解决一个Sping管理hibernate时的事务问题(No Hibernate Session bound to thread)
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a
- 解决WINDOWS 7中显示摄像头的简易方法
- Mysql select data from one table into a new one
- DOM和SAX比较和选择
- IOS7 适配应用高度
- Ubuntu 编译安装 hadoop 2.2.0
- No Hibernate Session bound to thread
- jquerymobile常用data属性
- 正则表达式
- 关于fastjson序列化部分源码解析
- 微软更新Visual Studio 2013正式版镜像(汇总直接下载地址)
- 反省——离职之后
- java桌面程序读取百度热搜的前10个关键字新闻
- 【模板方法模式-template】
- JAVA &&Tomcat安装设置