该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助& q# w- s: U& e0 Z- i* T
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:
# f3 z! Z. F- b. Z& u4 h6 y+ I* N5 }+ p/ C" P. G: N9 @
这是我spring配置信息:
' z. F8 |! @. `: v2 k; Q2 f' b' _" G, `( p, H2 m
<?xml version="1.0" encoding="UTF-8"?>2 I. m; r$ b( o- K$ s$ f4 V: z' J, o
<beans xmlns="http://www.springframework.org/schema/beans"9 N3 B+ d3 T& z7 d- ^# s
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' Y" {* u# @' C% x( g8 m7 S
xmlns:aop="http://www.springframework.org/schema/aop"
5 [! w( `/ h1 w) S7 j: h- h xmlns:context="http://www.springframework.org/schema/context"4 a. H$ E: f* S7 @# q Z
xmlns:p="http://www.springframework.org/schema/p"
- o) _3 @/ X9 Q! @2 f xmlns:tx="http://www.springframework.org/schema/tx"+ s0 Q+ N+ ^4 h
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd& B4 o. U/ ]5 B2 L
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd7 t B1 I. r/ {: c) C- c- k- f
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
% F* ]) F. z( j http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
9 B; f; v% E$ q7 K# O Q2 s0 N* y' F0 d) l$ }2 ]6 y
<!-- 配置连接池数据源 -->
B/ p. S! ?/ u" q. c <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">* K3 x8 O6 L9 t- k: M
<property name="jndiName">9 K! q0 p) Z2 u, \' D/ N9 m5 \
<value>java:comp/env/jdbc/oracle</value>. K7 [1 B$ Z6 a: |, s8 g
</property>
6 J% T4 |7 ~, i1 }9 e) }: O </bean> -->
5 {; R* Z/ V7 K0 Z" z <!-- 使用外部文件配置数据源 -->, g; P5 p0 V0 u4 T& E6 J: r
<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
& o9 t% v( ^' F# v; J <property name="location">
3 P4 v# i& a4 ~" j <value>classpath:jdbc.properties</value>0 H) b4 q3 X F z, l
</property>
/ B7 `/ J% @$ x0 j7 l </bean>1 l! V- C' h- T; c9 F& n% Z( H
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >9 K$ b8 `, x- E ~ ~
<property name="driverClassName" value="${driver}"/>
6 m" s P) C. }5 K7 A/ Y8 _ <property name="url" value="${url}"/>
, T! c" l O- T <property name="username" value="${username}"/>
! @9 e0 O3 e; Z; Q2 R/ r4 p <property name="password" value="${password}"/>
$ {% M1 d* T! L% E2 o, Y </bean>& K8 E4 E" l3 A1 `: Y
, H7 O' g) c7 H& n <!-- 配置session工厂 -->
) X9 D, T0 W+ o* A <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
6 z4 H7 {; M& Q/ N <property name="dataSource" ref="Source"></property>
5 y* [. L h+ }* w <property name="hibernateProperties">
1 H# z* k+ d9 Z' R" M2 G <props>
& V) V$ Z; a6 H! B$ a <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
$ g5 V" |& @7 P: l* N a <prop key="hibernate.current_session_context_class">% y* P9 H" P, H: t/ O+ l, J
org.springframework.orm.hibernate4.SpringSessionContext
2 O+ B+ r$ `* o </prop>
: b2 T& [0 p; r1 F4 t x9 H </props>' j* S" W* z" q3 S
</property>
1 B. m5 W3 T' R* `4 X8 l" a% p6 |1 E$ ] <property name="mappingResources">
( i# i1 l" R. Z <list>
) q7 P2 w M5 z! H <value>com/entity.Dept.hbm.xml</value>
. A$ \5 t' x/ x+ ^ <value>com/entity.Emp.hbm.xml</value>
" U' y8 E; ]2 L. x/ ~ </list>. A6 l7 h6 X5 L: z: E- w* n
</property>8 q7 l9 P* f& b! A/ \
</bean>
8 ?) I' \6 w2 _# u% X# i% A
4 w h5 L9 B% ?" [ <!-- 配置dao层bean -->/ N. C- f7 d9 _; L, E! X
<bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">6 b0 |% K7 l: d" q# W' A1 q
<property name="sessionfactory" ref="sessionFactory"></property>
- G C% Q% z4 J6 Q' s </bean>
" }+ `) X n1 x5 \4 [2 F) }& i% b: e/ [</beans>: V0 x9 c4 z/ | x& H( m
, X6 }1 `: v& g: W2 M
不管是用哪种jar包的配置都是这个问题,搞不懂 求解
: {0 j( h' q0 d) l |
|