该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
1 G5 c0 D$ e8 `' Oorg.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:
7 B( N+ a1 F1 w/ i& o. L3 x" h/ _( }1 t) S- V
这是我spring配置信息:
! c) B8 s; N" n8 o! k6 X1 }0 ^- U) k$ B2 Q7 A6 I5 w/ z5 M y D, G
<?xml version="1.0" encoding="UTF-8"?>
# K! |* W1 @$ Z7 R l) g5 s7 V<beans xmlns="http://www.springframework.org/schema/beans"
N* p0 R* `( z- x* C' \( k xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
$ _/ \1 J. j q+ c) z2 ^/ w xmlns:aop="http://www.springframework.org/schema/aop"8 Y, Y3 K) @# [. A* d( ^/ k2 B, ?
xmlns:context="http://www.springframework.org/schema/context") Z0 {5 F0 W: {3 w+ m/ k
xmlns:p="http://www.springframework.org/schema/p"5 ]2 }3 d0 e% x/ m6 s: `) ?+ l
xmlns:tx="http://www.springframework.org/schema/tx"
0 h2 E5 d, M+ v# ?8 S9 s' l0 D xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd2 m1 C( q% o" n& P3 r, S" ^
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd& C _1 { D7 a6 k9 k1 Z2 g
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd# i$ F4 P; D- t& J0 ?8 s
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"> t, U! Z+ | c. y, {7 `
2 Z4 l5 F0 g4 |5 U2 }6 ~5 R
<!-- 配置连接池数据源 -->
* G6 @7 O0 g& P. u- G i <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
, S5 v2 N7 W2 n4 I+ _ <property name="jndiName">! ~: ^6 h3 u E
<value>java:comp/env/jdbc/oracle</value>
3 d) k8 y- B0 v$ b# {+ G' w- | l/ g </property>& g4 B2 C1 N$ A' r+ d, E) e
</bean> -->8 o& ^$ S1 R Q l& Y
<!-- 使用外部文件配置数据源 -->
+ x* U5 h- r4 y+ |3 X: n <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">, r1 v' p; Y. k( |& `
<property name="location">
6 {" j1 [# f5 | <value>classpath:jdbc.properties</value>
# e, z; i2 ?% s q </property>
, I+ k6 l+ u! L </bean>
: z8 [# K! b! c <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >7 o9 [- G' p6 z, n y- N
<property name="driverClassName" value="${driver}"/># `# T9 e8 }4 ~; \/ U0 D
<property name="url" value="${url}"/>8 U: d" P d: W _: w8 a6 r
<property name="username" value="${username}"/>* C3 d0 E6 ~, S, Y8 T1 U" _
<property name="password" value="${password}"/>4 ~8 g9 e) A1 X) C+ P; W+ P1 l
</bean>) o" f8 S. b b, ?
7 F, C# E% X5 l( \1 G) y <!-- 配置session工厂 -->
( Z! T. u8 T7 F0 M <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">$ N, z% y0 E2 H+ }
<property name="dataSource" ref="Source"></property>
* L- P& q. u8 Z7 K& k5 N$ v <property name="hibernateProperties">. Z2 x* O, X, h9 I. c& o
<props>
8 E9 N6 F' q9 y B) D <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
3 i& v* L/ _ Q: `( [ <prop key="hibernate.current_session_context_class">, i# N9 n. X) |- j1 K# u" {/ H; H
org.springframework.orm.hibernate4.SpringSessionContext
+ p8 g' l7 t! j- v! h! q </prop>
3 u0 i2 u4 r& A9 q6 U9 E </props>
! l' I+ ?5 N' o' M; W: n1 E4 ^ </property>) G6 K: i; T9 a1 V2 s3 f
<property name="mappingResources">/ `9 @# e- D0 O' K+ d" ]
<list>
0 N- b, E4 W0 |3 n <value>com/entity.Dept.hbm.xml</value>
; o, T2 m2 }; b3 z <value>com/entity.Emp.hbm.xml</value>
( C0 H4 g- r" e0 K8 h </list>9 h" k; j9 W. N) r! p: |8 r
</property>/ B1 ] I6 P: Z' z8 R5 C5 e
</bean>
% [1 v6 k9 b$ @
5 |# { x5 e3 z% O8 \* L& p <!-- 配置dao层bean -->
0 Q5 R) `3 `& E5 C* u+ {, n <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
" f0 g2 b4 ^) f. L% D' n: j+ |9 G <property name="sessionfactory" ref="sessionFactory"></property>
0 r( v6 ~5 r7 @5 \$ p! I </bean>9 }( Y5 G7 s( H
</beans>, \" T/ y7 W+ z) c) r, F
, ?$ M' I: { ~/ b, A$ {不管是用哪种jar包的配置都是这个问题,搞不懂 求解, X5 W I; P. ~; P
|
|