该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
; i9 w$ a, T: C+ p* u* i) [- r: worg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Source' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:: ?2 e+ f j d- B
3 N8 ] e! H. H( D
这是我spring配置信息:
$ }/ T4 X2 C1 i7 y. o" g/ R4 I+ c
& A% ~9 t q; ?<?xml version="1.0" encoding="UTF-8"?>" {8 w6 L' n, ^3 s. h9 C' Q
<beans xmlns="http://www.springframework.org/schema/beans"
" ?* f( i: P+ Q' ^ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance". E1 N' u6 r) i
xmlns:aop="http://www.springframework.org/schema/aop". i* |1 \( D( q& d, [
xmlns:context="http://www.springframework.org/schema/context"
6 S' s% Q) } V xmlns:p="http://www.springframework.org/schema/p"
( M- }# V( ^0 C/ }% y9 p& Q. Q+ r xmlns:tx="http://www.springframework.org/schema/tx"
2 z0 E8 B& O+ b c, X4 G xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd! |' E: ]1 L6 f- U n$ @# h0 b B1 W
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
@6 v6 L/ y8 z# Q, x* m1 f4 J3 u http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
$ Q! Y: B7 u% o http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">' w; p, M4 C& W6 B
5 p* S( M; b& y
<!-- 配置连接池数据源 -->" ]* r% o$ h; P
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
; U3 m' q) c: h) e8 G7 O; F <property name="jndiName">
* D4 t. Y" X6 R: v <value>java:comp/env/jdbc/oracle</value>
2 [! X9 o0 s8 i </property>
4 T1 v w" x1 J0 a" e </bean> -->+ j$ |' e5 w. m' ~: j
<!-- 使用外部文件配置数据源 -->; T, V: N7 Y7 S4 I0 x/ l! r; ?
<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
! M l: j q4 `& u$ i' C. s- N <property name="location">
% H: Z$ r" O' r! v' P <value>classpath:jdbc.properties</value>7 J# S% B0 d1 c/ g% C0 G4 ?
</property>
7 b! |; l" N4 W. y/ L& [$ i9 ^ </bean>! V3 _& a& f5 u' K5 {
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >+ k& o" @0 E* `$ K9 a
<property name="driverClassName" value="${driver}"/>/ m( S) a+ k/ C8 B. _# W* @. w
<property name="url" value="${url}"/>
6 a, X- p( N9 Y- ?2 H1 D <property name="username" value="${username}"/>
+ _: Q( Z$ n5 z' ~ <property name="password" value="${password}"/>
+ b* y+ Y2 N) l( _9 [ </bean>
$ @% T/ A8 P" B: T
0 I1 z$ Y- |4 k( y O8 ?- i" A1 j <!-- 配置session工厂 -->, m: c. v! J8 n7 q" b0 Q
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
3 m. p# w- q* ~ <property name="dataSource" ref="Source"></property>
/ V( F. _9 \3 e$ t% b( w! m) N <property name="hibernateProperties">8 K$ r# k: y/ o- g2 ?4 y
<props>
! X+ A( }6 S/ }* X% w% | <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
: B0 [! \& a" A, y/ l <prop key="hibernate.current_session_context_class">
) }7 h. O; M' L0 S org.springframework.orm.hibernate4.SpringSessionContext
p. ]) `2 g& F </prop>
- c V) D& k' ?+ r1 \+ C- i </props>
0 ]7 }2 K) @9 G0 I </property># G! g4 Q: j; |
<property name="mappingResources">
! Z. R& W. F' v3 G- l: Y4 y$ m <list>
; l& P$ ?$ j% R5 l# ] <value>com/entity.Dept.hbm.xml</value>& A+ x0 t/ h8 Q" s
<value>com/entity.Emp.hbm.xml</value> T* a2 @6 J7 s u
</list>
$ |+ A& J6 e1 M* E- ] </property>1 e L& y* k# t- R( ?& u* \9 i
</bean>* m6 g0 ?4 }7 I7 M3 s
; B# }5 S6 F7 V8 G <!-- 配置dao层bean -->
( |9 D( U; ~2 n0 _: u <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">+ e( e/ [7 h7 g& @
<property name="sessionfactory" ref="sessionFactory"></property>$ }. B1 L0 y2 Y" o
</bean>, o5 U& a1 I5 g& K% o% X& Q& g. g
</beans>+ _* K7 K& H. u: y
( g/ W2 Y" Z7 r; p5 G
不管是用哪种jar包的配置都是这个问题,搞不懂 求解5 R( {& P; A+ J0 T9 y; e
|
|