首页 新闻 搜索 专区 学院

在线等 大神帮忙

0
[待解决问题]

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

这是怎么回事  求帮助 

豆小泪的主页 豆小泪 | 菜鸟二级 | 园豆:202
提问于:2016-08-29 16:00
< >
分享
所有回答(3)
0

服务器500了,服务器内部错误。。具体信息看后面呗。

顾晓北 | 园豆:10055 (专家六级) | 2016-08-29 16:02

请问怎么解决啊 

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:06

大神  求帮助啊 

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:20

@豆小泪: 看样子你的服务器端是Java,然而我不玩Java。。。

支持(0) 反对(0) 顾晓北 | 园豆:10055 (专家六级) | 2016-08-29 16:22

@顾晓北: 好吧   谢咯

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:22
0

检查你的hibernate相关配置

全力以赴001 | 园豆:616 (小虾三级) | 2016-08-29 16:02

hibernate和spring连一起的 

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:04

我发给你看看

<?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:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd"
default-lazy-init="false" default-autowire="byName">

 

<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url"
value="jdbc:oracle:thin:@localhost:1521:orcl">
</property>
<property name="username" value="dxl"></property>
<property name="password" value="dxl123456"></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.Oracle9Dialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/entity/Transregister.hbm.xml</value>
<value>com/entity/Regioninfo.hbm.xml</value>
<value>com/entity/Cearbanklist.hbm.xml</value>
<value>com/entity/Sysrole.hbm.xml</value>
<value>com/entity/Rolemenu.hbm.xml</value>
<value>com/entity/Merchant.hbm.xml</value>
<value>com/entity/Agentinfo.hbm.xml</value>
<value>com/entity/Sysusers.hbm.xml</value>
<value>com/entity/Orgtransfer.hbm.xml</value>
<value>com/entity/Registersetfee.hbm.xml</value>
<value>com/entity/Merchantsettlechange.hbm.xml</value>
<value>com/entity/Oemrelation.hbm.xml</value>
<value>com/entity/Agentchangeinfo.hbm.xml</value>
<value>com/entity/Transjsdate.hbm.xml</value>
<value>com/entity/Notifycallback.hbm.xml</value>
<value>com/entity/Callbackredirect.hbm.xml</value>
<value>com/entity/Transjsinfo.hbm.xml</value>
<value>com/entity/Sxfvvcard.hbm.xml</value>
<value>com/entity/Vefcodeinfo.hbm.xml</value>
<value>com/entity/Uploadfileinfo.hbm.xml</value>
<value>com/entity/Orginfo.hbm.xml</value>
<value>com/entity/Autotableid.hbm.xml</value>
<value>com/entity/Channel.hbm.xml</value>
<value>com/entity/Employeeinfo.hbm.xml</value>
<value>com/entity/CearbanklistOld.hbm.xml</value>
<value>com/entity/Sysmenu.hbm.xml</value>
<value>com/entity/Transactioninfo.hbm.xml</value></list>
</property></bean>
<!-- 1、事务管理器 -->
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<!-- 2、配置拦截规则 -->
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true" />
<tx:method name="find*" read-only="true" />
<tx:method name="load*" read-only="true" />
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="*" propagation="REQUIRED" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config proxy-target-class="true">
<aop:pointcut expression="execution(* service.*.*(..))"
id="serviceMethod" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod" />
</aop:config>

<!-- 注解扫描全部类文件 -->
<context:annotation-config />
<context:component-scan base-package="com"/>
</beans>

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:04

还有就是我的springmvc中只配置了这一句话 <context:component-scan base-package="com"/>注解

支持(0) 反对(0) 豆小泪 | 园豆:202 (菜鸟二级) | 2016-08-29 16:20
0

<context:annotation-config />
<context:component-scan base-package="com"/>

这两句话是不是要放在顶部位置啊(我是小白,说错请谅解)

洒水閃人 | 园豆:210 (菜鸟二级) | 2016-09-07 20:34
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册