- 浏览: 407622 次
- 性别:
- 来自: 郑州
文章分类
最新评论
-
yan789654100:
先谢谢了,去研究一下
Java网络围棋游戏源码含大厅,仿QQ游戏 -
dan0773:
火狐里面用不了
梅花雨日历控件源码,及应用实例 -
左手边:
挺好的不错
Velocity教程 -
liuxuejin:
既然是教程,连个例子都没有!顶多是个笔记而已
Velocity教程 -
sky_pearl:
泪奔……求大厅代码!!!
Java网络围棋游戏源码含大厅,仿QQ游戏
2:22:11,640 ERROR [default]:250 - Servlet.service() for servlet default threw exception
java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:350)
at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:200)
at com.sea.user.dao.BaseDAO.getSession(BaseDAO.java:23)
at com.sea.user.dao.impl.UserDAO.saveUser(UserDAO.java:16)
at com.sea.user.service.impl.UserService.saveUser(UserService.java:14)
at com.sea.user.action.UserAction.register(UserAction.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
请解决一下,谢谢!
这是BaseDAO内容
applicationContext.xml 文件配置
java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:350)
at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:200)
at com.sea.user.dao.BaseDAO.getSession(BaseDAO.java:23)
at com.sea.user.dao.impl.UserDAO.saveUser(UserDAO.java:16)
at com.sea.user.service.impl.UserService.saveUser(UserService.java:14)
at com.sea.user.action.UserAction.register(UserAction.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
请解决一下,谢谢!
这是BaseDAO内容
public class BaseDAO { private SessionFactory sessionFactory; public SessionFactory getSessionFactory() { return sessionFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public Session getSession(){ Session session = sessionFactory.openSession(); return session; } }
applicationContext.xml 文件配置
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"> </property> <property name="url" value="jdbc:mysql://localhost:3306/cms"></property> <property name="username" value="root"></property> <property name="password" value="root"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">false</prop> </props> </property> <property name="mappingResources"> <list> <value>com/sea/user/vo/Users.hbm.xml</value> <value>com/sea/user/vo/Usersdetail.hbm.xml</value> </list> </property> </bean> <bean id="baseDAO" class="com.sea.user.dao.BaseDAO"> <property name="sessionFactory"> <ref bean="sessionFactory"/> </property> </bean> <bean id="userDAO" class="com.sea.user.dao.impl.UserDAO" parent="baseDAO" > </bean> <bean id="userService" class="com.sea.user.service.impl.UserService"> <property name="userDAO"> <ref bean="userDAO"/> </property> </bean> <bean id="userAction" class="com.sea.user.action.UserAction"> <property name="userService"> <ref bean="userService"/> </property> </bean> </beans>
评论
2 楼
pxysea
2007-06-11
好了, 但还不知道什么原因。代码也没有改动,莫明的就可以了。感觉是 IE 里的缓存吧。比较郁闷啊
1 楼
dennis_zane
2007-06-11
没有配置声明性事务,找个入门文章看下吧
发表评论
-
Extjs 验证使用
2012-08-10 10:16 964/** * 用户表单面板 */ Ext.def ... -
使用ext的store.load 之后然后使用store.getCount 值为零解决办法
2012-07-13 09:12 1184使用ext的store.load(),之后然后使用store. ... -
什么样的cms系统算是强大
2012-07-10 17:41 962现在建站的cms系统层出不穷。从简单的到功能复杂的。从功 ... -
OpenCV背景去除的几种方法(转)
2012-07-02 10:15 8556OpenCV背景去除的几种方法 1、肤色侦测法 肤 ... -
error: command 'mt.exe' failed with exit status 31
2012-06-18 17:39 2384python setup.py build_ext -i ... -
MyBatis 3 + Spring3 多数据源配置
2012-02-27 14:50 1357详细内容地址: 终于把 MyBatis 3 和 Sp ... -
Google Earth 开发示例(Hello World)
2011-04-13 17:06 1601Google Earth Hello World 示例 &l ... -
DB2 分页查询方法,查询top N 条记录
2011-01-13 18:50 27291. db2分页查询sql select * f ... -
Birt 中的通过Script加入调试输出SQL语句代码
2010-11-18 15:54 1375用Brit制作报表时可通过在Script脚本中加入以下代码输出 ... -
TSM - Creating an include-exclude list (optional)
2010-06-09 11:00 1527Creating an include-exclude l ... -
TSM - Configuring the Web client
2010-06-09 10:51 902Configuring the Web client The ... -
Linux下 Tsm 服务器、客户端安装配置全过程
2010-05-17 10:06 1726系统环境:LINUX AS5 存储:IBM DS400 ... -
安装DB2补丁步骤
2009-10-27 17:30 17381. 通过运行 su - root ... -
WAS 6.0.2.9 部署应用使用过滤器问题解决办法
2009-08-05 16:07 1410支撑环境: IBM WebSphere Application ... -
MyEclipse5.5GA配置Websphere V6.1 全过程(详细版)
2009-07-16 13:32 1257转载自:http://blog.chinaunix.net/u ... -
WebSphere Application Server 6.0.2.9 配置 SqlServer 2000 SP2时出错问题解决
2009-07-15 12:56 1766WebSphere Application Server 6. ... -
WAS 5.1 部署应用容器属性配置
2009-07-07 14:52 2505WAS 5.1 部署应用容器属性配置 引用地址:http:/ ... -
Struts JSR168 Portlet using the ITIM API
2009-06-02 19:29 955Leveraging the IBM Tivoli Ident ... -
ITIM API
2009-06-02 19:22 917ITIM API http://publib.boulder ... -
打开IBM WebSphere Portal trace 收集
2009-05-26 10:37 1400Collecting login-specific infor ...
相关推荐
No Hibernate Session bound to thread,没有绑定线程解决办法,找了好久才找到的
Hibernate-nosession浅谈代码案例。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
hibernate就会抛出: No Hibernate Session bound to thread, and configuration does not allow creation of one here}异常。 在实际的SSH web应用开发中,我们通常用spring来进行事务的管理。我们一般不会在dao层...
在spring+hibernate的框架中定时操作数据库,主要是拿到sessionFactory,不会出现no session 和transaction no-bound等问题,由sessionFactory完成对数据的操作,有些包是没有用的,有兴趣的可以自己删除掉
1. Introduction to Hibernate 1.1. Preface 1.2. Part 1 - The first Hibernate Application 1.2.1. The first class 1.2.2. The mapping file 1.2.3. Hibernate configuration 1.2.4. Building with Ant 1.2.5. ...
发现在客户的某个PHP版本下,执行某类操作的时候,总是会报如下错误 Invalid parameter number: no parameters were bound,经google,发现是php版本过低导致
配置tomcat7sqlserver数据连接池java 利用数据源对象建立数据库连接时的错误: Name jdbc is not bound in this Context 解决方案
Name salesDataSource is not bound in this Context,连接池的问题
On a search problem related to branch-and-bound procedures.pdfOn a search problem related to branch-and-bound procedures.pdfOn a search problem related to branch-and-bound procedures.pdfOn a search ...
Android Service之bound实现
branch and bound
ADO Data Bound Class WizardADO数据类向导
upper confidence bound implementation
本案例主要是分别实现Spring与jdbc和hibernate结合的事务控制,如果该案例有出入的地方,请给我留言,我们一起交流
lower_bound函数lower_bound函数用法及应用领域和案例分享lower_bound函数用法及应用领域和案例分享lower_bound函数用法及应用领域和案例分享lower_bound函数用法及应用领域和案例分享lower_bound函数用法及应用领域...
NULL 博文链接:https://samson7b.iteye.com/blog/1393458
usb分析软件,可以查看系统里的usb设备,并有具体分析
本推理系统可用于命题、谓词、注解命题和注解谓词的自动推理,系统自动识别是何种类型推理。 <br>注解命题和注解谓词的推理可以解决一般的推理中的不协调问题(即系统中存在矛盾)。
Ant-Based Routing Algorithm to Achieve the Lifetime Bound for Target Tracking Sensor Networks