为了账号安全,请及时绑定邮箱和手机立即绑定

这是spring的配置 不知道哪里错了

<?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"/>

<!-- 配置c3p0连接池 -->

<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的相关属性 -->

<bean id="sessionFatory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

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

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

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

<property name="hibernateProperties">

  <props>

<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</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>cn/star/ssh/entity/Product.hbm.xml</value>

</list>

</property>

</bean>

<!-- 配置Action类 -->

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

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

</bean>


<!-- 配置业务层的类 -->

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

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

</bean>

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

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

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

</bean>

</beans>


正在回答

2 回答

sessionFatory写错了,应该是sessionFactory

0 回复 有任何疑惑可以回复我~
#1

FloatingShuYin 提问者

非常感谢!
2016-10-31 回复 有任何疑惑可以回复我~

报的什么错误呀

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

这是spring的配置 不知道哪里错了

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信