该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助# w. a! k, h( {' Z' \
org.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:
3 c; H- |) {+ N
" I. V6 |2 [2 Y# B8 o# ?这是我spring配置信息:0 x1 T E* c; j
4 w; t4 n4 v5 [ x) m7 _ i9 ^! n$ K
<?xml version="1.0" encoding="UTF-8"?>
W I2 k" L4 q8 F# W. e4 v<beans xmlns="http://www.springframework.org/schema/beans"
) l# |9 N- J! F, W% b4 b& [ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
, f" v' M* a6 b1 o xmlns:aop="http://www.springframework.org/schema/aop"
0 l' \ v0 G# I1 q xmlns:context="http://www.springframework.org/schema/context"0 [3 k+ g/ }0 P s6 Z: _* }
xmlns:p="http://www.springframework.org/schema/p"
& F k4 H; E. t8 F* z- U! ?: w xmlns:tx="http://www.springframework.org/schema/tx"
U0 s9 X W( T xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd* d5 U ?" v d
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
- J4 ?, x, w# A1 ]; }$ D& E ]# [ http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd! Y4 _$ ? D5 j
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">9 q5 ]% y( ]' y4 j! \+ n9 b
( }' U$ ~# j! Z& v& @
<!-- 配置连接池数据源 -->9 |, v5 O# R1 F: _5 X5 d r
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">9 e% l$ d/ h% Z- J: j
<property name="jndiName">
. |9 e" Z* x, d x% f) j1 ` <value>java:comp/env/jdbc/oracle</value>
$ P! s; ~, P2 R' O/ [* @" { </property>% ?1 |& v! u% V% g
</bean> -->2 O+ C) L* i! O
<!-- 使用外部文件配置数据源 -->
& j; t Z; z9 o' Y5 N H <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
/ f# B/ U4 v/ x' d" |1 P <property name="location">
9 |- h. Y5 X/ Q( q M5 ^ <value>classpath:jdbc.properties</value>7 N3 ~# w* O: A
</property>; C# i+ M5 {! b) t
</bean>* g( O6 ^" O' |+ \ f5 }
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >$ B# q4 d2 t* R# w" {4 A
<property name="driverClassName" value="${driver}"/>
4 |2 \2 H( @4 q# B! L <property name="url" value="${url}"/> ]2 L" g# d. s! X V6 G% B3 N
<property name="username" value="${username}"/>+ Z' z" j7 V# p1 n t" q
<property name="password" value="${password}"/>+ D2 j1 h' o% T5 a
</bean>
% g4 b. y: U, [% p& P# Y
0 K: h+ A- m" h) j; n/ M0 F, D <!-- 配置session工厂 -->
% Q) b1 l1 t" ]& s1 o <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">/ j8 i A" {* t, E/ N! Y9 _
<property name="dataSource" ref="Source"></property># m& }: k1 a- {1 g4 ?5 W
<property name="hibernateProperties">; b. n: Q8 u/ B/ H' g
<props>6 h$ m# W, Z# M$ d( d
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
! c/ C6 M- n; f% Y/ Q" B# ] <prop key="hibernate.current_session_context_class">! a- _1 ?( `+ T
org.springframework.orm.hibernate4.SpringSessionContext
b8 B4 W' |# _3 l5 I" |9 b </prop>
% s- c/ @* o2 c' f* ^% z) X </props>" P; W2 E" \9 n7 r: q$ E
</property>
, N, B/ R( I& [ c. @ <property name="mappingResources">7 s% @! I: H1 s( G) D
<list>/ v" Z W7 H: s. ^8 K2 B$ i$ o
<value>com/entity.Dept.hbm.xml</value>- }( c7 r# Z+ K. o! q
<value>com/entity.Emp.hbm.xml</value>: X( u, f/ O: |' | w/ R3 Q
</list>
% O3 k) d4 a3 T# ]! T. R: b# b& C. k </property>
1 h; s# _; S) C9 x: o </bean>4 v( p. { S0 n
r5 s5 u7 g9 Z! B
<!-- 配置dao层bean -->
& v ~& `( U* S$ x" O$ _ L E5 W7 J <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">+ S M. y; N+ ?) p' n0 C
<property name="sessionfactory" ref="sessionFactory"></property>
- b4 K2 ^1 J4 m8 C, _' Y </bean>& n2 O2 c2 j+ V) }. @4 `; j
</beans>
" T' a" F1 h$ q( L W4 b# R) A
7 s, i* E2 a9 r9 k不管是用哪种jar包的配置都是这个问题,搞不懂 求解. m# _' J. V2 ~# [2 A5 e( W2 X, J2 ?
|
|