求救!!!spring3+hibernate3.3事务配置问题

问题描述

<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.0.xsd"><beanid="txManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager"><propertyname="sessionFactory"ref="hibernateSessionFactory"/></bean><tx:annotation-driventransaction-manager="txManager"/><beanid="dataSource"class="org.apache.commons.dbcp.BasicDataSource"><propertyname="driverClassName"value="com.mysql.jdbc.Driver"></property><propertyname="url"value="jdbc:mysql://localhost:3306/ant1k"></property><propertyname="username"value="ant1k"></property><propertyname="password"value="67173181"></property></bean><beanid="hibernateSessionFactory"class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><propertyname="dataSource"><refbean="dataSource"/></property><propertyname="hibernateProperties"><props><propkey="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><propkey="show_sql">true</prop><propkey="current_session_context_class">thread</prop><propkey="format_sql">true</prop><propkey="hbm2ddl.auto">update</prop></props></property><propertyname="mappingDirectoryLocations"><list><value>file:src</value></list></property></bean></beans><beanid="txManager"在此行报错class="org.springframework.orm.hibernate3.HibernateTransactionManager">buildpathisincomplete.Cannotfindclassfilefororg/hibernate/HibernateException开发环境是myeclipse已导入了springcore,jdbcpersistence,persistencecore,aoplibraries我不明白为什么报错怎样解决求高手解答!!

解决方案

解决方案二:
应该是<propertyname="mappingDirectoryLocations"><list><value>file:src</value></list>配置有问题你想通过它来加载什么?

时间: 2024-07-30 02:56:39

求救!!!spring3+hibernate3.3事务配置问题的相关文章

spring3 +hibernate3的事务配置不生效,求帮助

问题描述 spring3 +hibernate3的事务配置不生效,求帮助 <tx:advice id="txAdvice" transaction-manager="hibernateTransactionManager"> <tx:attributes> <tx:method name="get*" read-only="true"/> <tx:method name="q

Jboss7上+maven搭建struts2+spring3+hibernate3完整能运行

这是一个采用maven项目管理工具,集成struts2+spring3+hibernate3+mysql的一套框架模板,只是提供集成成功,struts2我采用的是零配置方式的,如果对着stuts2零配置方式不理解的,则回头学习一下.该程序测试时在jboss7 AS上运行成功.但是没有使用jndi数据源,在jboss7中数据源配置需要按照module的方式配置,但是jboss4中数据源则相对简单一点.jboss4中使用spring和struts2集成时会有问题,这里有一个解决的文章可以参考一下:h

spring mvc+spring3+hibernate4的事务不会自动清楚session缓存

问题描述 spring mvc+spring3+hibernate4的事务不会自动清楚session缓存 没有手动清缓存,就不执行插入SQL了手动清缓存的话,就能添加成功. 有知道原因的大神吗!!! 解决方案 没遇到过这种情况,tomcat么 解决方案二: 你这个没有加上事务,save时不会自动flush,加了事务之后commit时会自动flush.你配置事务了吗? 解决方案三: 贴出事务来看看,会不会没起作用

mysql 回滚-spring3+mybatis+myql事务不生效

问题描述 spring3+mybatis+myql事务不生效 代码格式为 @Transactional(rollbackFor=java.lang.Exception.class, propagation=Propagation.REQUIRED, readOnly=false) public void excuDevOrAppPagRel(DevPackageRln devPackageRln) throws Exception{ //具体操作,无try-catch操作 } mysql所有表的

Spring3+Hibernate3+Struts2

问题描述 Causedby:org.springframework.beans.factory.BeanNotOfRequiredTypeException:Beannamed'org.springframework.transaction.interceptor.TransactionInterceptor#0'mustbeoftype[org.aopalliance.aop.Advice],butwasactuallyoftype[org.springframework.transactio

Spring3+Hibernate3升级为Spring4+Hibernate4

写在开始 今天,把当前项目做了一下升级,特此记录一下. 由于历史原因,项目本身并不是Maven项目,所以升级JAR包都是手动从Maven库中下载,然后load进项目lib. 目前 spring版本已经更新至5,但是4还是主流版本. 相比spring3,spring4新特性如下: Spring4新特性--泛型限定式依赖注入 Spring4新特性--核心容器的其他改进 Spring4新特性--Web开发的增强 Spring4新特性--集成Bean Validation 1.1(JSR-349)到Sp

spring3 注解式事务不起作用

问题描述 用spring3+hibernate配置注解式事务,测试的时候抛出异常总是不回滚.spring主配置文件hibernate.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-

Spring 多数据源事务配置问题

在SpringSide 3 中,白衣提供的预先配置好的环境非常有利于用户进行快速开发,但是同时也会为扩展带来一些困难.最直接的例子就是关于在项目中使用多个数据源的问题,似乎 很难搞.在上一篇中,我探讨了SpringSide 3 中的数据访问层,在这一篇中,我立志要解决多数据源配置的难题,我的思路是这样的: 第一步.测试能否配置多个DataSource第二步.测试能否配置多个SessionFactory第三步.测试能否配置多个TransactionManager第四步.测试能否使用多个Transa

spring + ibaits事务配置问题

问题描述 <!-- sqlMapClient配置--> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="classpath:sql-map-config.xml"/> <proper