该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
3 {* j7 R4 t' \" g Rorg.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:+ p3 L; b$ Z8 A* |% ]
: x4 H" T }8 E/ H9 _" A& g6 X6 U2 @这是我spring配置信息:9 k$ T8 O; \. T/ X, q
1 L5 u0 g, n a3 j<?xml version="1.0" encoding="UTF-8"?>
' P6 D9 G+ N# |* Q$ t<beans xmlns="http://www.springframework.org/schema/beans"
9 F$ }% [6 x/ L9 n; J7 e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"* B6 E9 s2 X9 N. w0 J
xmlns:aop="http://www.springframework.org/schema/aop": V, c( m2 g _' w {4 O
xmlns:context="http://www.springframework.org/schema/context"
5 b6 e* h9 p# w% ?. l xmlns:p="http://www.springframework.org/schema/p"
$ d8 ~9 S) l+ v2 i7 q2 ~/ B xmlns:tx="http://www.springframework.org/schema/tx"
2 m, O: N' J. e6 a- f$ l& g8 Y' r xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd& M( j5 d. c5 f n9 f
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd' [7 p6 L& b. r5 p& q& r z0 }
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd# o! c9 Y3 R0 D0 E5 h
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">7 Y! _1 Q- K. a* z6 ]5 r
/ X& W& z. K# n! w# m
<!-- 配置连接池数据源 -->3 _! G+ P. S3 Z8 B- m$ q
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">$ v4 O; }$ M$ B" P. q
<property name="jndiName">! P8 p/ f( G* L2 y/ Y$ t* k
<value>java:comp/env/jdbc/oracle</value>+ c' p9 v/ e6 }5 _6 i* v5 m. T) }+ }
</property>9 [: ]) F1 [6 W# \2 s& H% z' W$ l `1 I
</bean> -->- K' v" R: w1 Q( S6 R
<!-- 使用外部文件配置数据源 -->: l! Y1 f# s# U& s/ D' k
<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">5 x4 L) m5 B% l9 {
<property name="location">
0 G1 C/ k' ^+ X) H <value>classpath:jdbc.properties</value>
g2 R j+ L6 [# B) C </property>$ v; s" D6 J( g; `) H0 _5 n
</bean>3 u0 K0 \ Y$ Q! ~- N$ a
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >0 R% A1 ^% u- q+ @
<property name="driverClassName" value="${driver}"/>- D" z" c* m# Q2 R5 G$ X8 l% ^
<property name="url" value="${url}"/>6 g' C- ?0 i) n( m, u$ U! f7 f
<property name="username" value="${username}"/>
$ b" a4 k6 n* B+ x <property name="password" value="${password}"/>: O* S+ @3 i# y8 k3 a
</bean>
: ?/ W: V+ C) Y( r5 k2 A: U & [4 n7 U+ W d$ Y) X3 ^
<!-- 配置session工厂 -->
. S8 U. G, L% S' x2 |4 H9 x" I1 N <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">$ M8 ?3 b [9 U1 o6 o
<property name="dataSource" ref="Source"></property>
. A, Z+ O+ Z" _1 X! v; } <property name="hibernateProperties">% T7 r0 w' ~& U/ J6 t0 g h
<props>( L5 I2 O. k: V% J/ u
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
3 S$ L- M2 R: N( n4 x5 M <prop key="hibernate.current_session_context_class">; M8 X' y7 j, m) Y
org.springframework.orm.hibernate4.SpringSessionContext
$ r I: D6 E. d' z8 j. u </prop>" X" `& y% O' w$ k( F1 U& B- g
</props>4 ~* s* }8 u) R$ \* e7 c+ V b l
</property>
) D7 a0 [6 H2 B2 b <property name="mappingResources">
$ E2 @8 D1 G% m. ^7 P% u7 W <list>
9 F* G, `# s1 K- x/ b# i5 i <value>com/entity.Dept.hbm.xml</value>+ b/ F, F2 _5 i
<value>com/entity.Emp.hbm.xml</value>
6 Y! N, u% Q5 ^& Y# A1 c </list>
% I1 r7 Z, R7 d# y# b& j </property>
# b( |) J% E, X0 k' d </bean>
; M7 o- R! ^' ]/ B Y2 _5 d# n 4 A# M0 H. Q/ X$ U$ d- Y
<!-- 配置dao层bean -->3 Q2 \, I! x; a) A; L* P
<bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
, r% W2 v6 ?- S. r. C0 I6 M6 N0 U <property name="sessionfactory" ref="sessionFactory"></property>
2 A* R. t S. Q( ] </bean>
3 {3 P2 U I& X( _* J# c* `</beans>$ G2 I" s/ A' |+ x( K1 Z
/ Y7 N* ^0 m4 g2 e& j不管是用哪种jar包的配置都是这个问题,搞不懂 求解2 l2 Q% e" r4 t8 P
|
|