求助:spring的依赖注入配置问题
初学srping ,请不吝赐教,谢过!!
spring-context.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />
<property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:jbpm" />
<property name="user" value="jbpm" />
<property name="password" value="jbpm" />
<property name="maxPoolSize" value="40" />
<property name="minPoolSize" value="1" />
<property name="initialPoolSize" value="1" />
<property name="maxIdleTime" value="20" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources" >
<list>
<value>com/easyweb/core/module/User.hbm.xml </value>
<value>com/easyweb/core/module/Role.hbm.xml </value>
</list>
</property>
</bean>
<import resource="app-action.xml" />
<import resource="app-security.xml" />
</beans>
app-action.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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<context:annotation-config />
<bean id="udi" class="com.easyweb.core.dao.impl.UserImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="userAction" class="com.easyweb.core.action.UserAction">
<property name="ud" ref="udi"></property>
</bean>
<bean id="rdi" class="com.easyweb.core.dao.impl.RoleImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="roleAction" class="com.easyweb.core.action.RoleAction">
<property name="rd" ref="rdi"></property>
</bean>
</beans>
系统启动报错,初始化不成功,在udi装载时,要求datasouces或jdbctemplete
这里,udi的配置用到了sessionFactory,而sessionFactory的配置有datasource
以上配置有什么不对?
这种情部该如何配置?