第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Could not open Hibernate Session for transaction;是什么問(wèn)題

點(diǎn)提交時(shí)出現(xiàn)這個(gè)錯(cuò)誤

Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext


http://img1.sycdn.imooc.com//5e677e5900017b9e30001616.jpg


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" xmlns:context="http://www.springframework.org/schema/context"

xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"

xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"

xsi:schemaLocation="

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd

http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd

http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd

http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd">


<!-- 引入外部的屬性文件 -->

<context:property-placeholder location="classpath:jdbc.properties"/>

<!-- 配置連接池 -->

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

<property name="driverClass" value="${jdbc.driverClass}"/>

<property name="jdbcUrl" value="${jdbc.url}"/>

<property name="user" value="${jdbc.username}"/>

<property name="password" value="${jdbc.password}"/>

</bean>

<!-- 配置Hibernate的相關(guān)屬性 -->

<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

<!-- 注入連接池 -->

<property name="dataSource" ref="dataSource"/>

<!-- 配置Hibernate的屬性 -->

<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>

<prop key="hibernate.show_sql">true</prop>

<prop key="hibernate.format_sql">true</prop>

<prop key="hibernate.hbm2ddl.auto">update</prop>

</props>

</property>

<!-- 加載Hibernate中的映射文件 -->

<property name="mappingResources">

<list>

<value>com/ssh/domain/Product.hbm.xml</value>

</list>

</property>

</bean>

<!-- 配置Action的類 -->

<bean id="productAction" class="com.ssh.action.ProductAction" scope="prototype">

<!-- 手動(dòng)注入Service -->

<property name="productService" ref="productService"/>

</bean>


<!-- 配置業(yè)務(wù)層的類 -->

<bean id="productService" class="com.ssh.service.ProductService">

<property name="productDao" ref="productDao"/>

</bean>

<!-- 配置DAO的類 -->

<bean id="productDao" class="com.ssh.dao.ProductDao">

<property name="sessionFactory" ref="sessionFactory"/>

</bean>

<!-- 配置事務(wù)管理器 -->

<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">

<property name="sessionFactory" ref="sessionFactory"/>

</bean>

<!-- 開啟注解事務(wù) -->

<tx:annotation-driven transaction-manager="transactionManager"/>

</beans>


正在回答

1 回答

是會(huì)話中止了吧

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

Could not open Hibernate Session for transaction;是什么問(wèn)題

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)