该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
4 V& u H1 A2 v* [" I- \5 ]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:
" w; F9 {* Z _) {
, g" l l; g5 J: V9 Q这是我spring配置信息:
' R9 a' q& r' |9 V% m% [- t I) R) f7 y. `3 b$ \" q5 `4 g, |1 ^) Z f# {. ]
<?xml version="1.0" encoding="UTF-8"?>
8 O6 Y7 ?( Q8 M% G l" [" Y<beans xmlns="http://www.springframework.org/schema/beans" k3 X) ]& B# a0 y$ f/ @
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"% k3 X- ?: m% L- D
xmlns:aop="http://www.springframework.org/schema/aop"
- L+ }3 h! \7 ^, t xmlns:context="http://www.springframework.org/schema/context"' H3 ^0 Y2 t2 s
xmlns:p="http://www.springframework.org/schema/p" A" {8 Y, ~, k1 L
xmlns:tx="http://www.springframework.org/schema/tx"# n; n: e( [( R! e$ X
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
4 g5 G4 [8 J; F! q4 h http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
4 N$ K2 q" c7 t1 v http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd% z: L0 ^/ {& q+ ?( A9 H" @) ]* m
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
- d5 i& Q) U& }: s/ E: ]8 x- {6 {% P( H
<!-- 配置连接池数据源 -->
# E2 t5 W( ^4 W3 @ <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
$ u: {9 w5 a+ U( N9 \ <property name="jndiName">9 u% H1 X* S6 E+ b
<value>java:comp/env/jdbc/oracle</value>; K* {+ j- K! g
</property>
, Z' @; ~. W7 b4 v- C" W </bean> -->" @: j! z; E9 E9 T A! i$ E
<!-- 使用外部文件配置数据源 -->( T: }: M- s2 F
<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">& {8 O+ C, r* W4 w/ g
<property name="location">! R3 F) `2 B& R) Q) R
<value>classpath:jdbc.properties</value>; F/ x* i% r3 r& [; R3 \, c
</property>" X) x8 R0 [, f1 b' {! h- b
</bean>
, h; K9 B" q# V$ `4 [ <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >" j% ]& E- W4 |% s8 e
<property name="driverClassName" value="${driver}"/>
- p! |) T7 w2 k( m+ M. g: b. W; \ <property name="url" value="${url}"/>
" C% d( A( K- z <property name="username" value="${username}"/>( Y1 T0 x/ P0 S+ Z O( G, N
<property name="password" value="${password}"/>: r1 X+ Y3 A5 W: S, z
</bean>
( v( Z- e6 F. \" R) l( C6 w
5 l! o1 j: Y% K" m3 k# |4 u# l <!-- 配置session工厂 -->
4 c- T7 p9 d5 q7 Z' j$ V <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
. I$ l4 k# T( l2 m$ Z) ^ <property name="dataSource" ref="Source"></property>
! s2 X& ^ j7 Q) d+ s# A, P <property name="hibernateProperties">
$ @; Y5 X( X* [* ? <props> E9 J/ Y4 t$ ^( n0 q
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>. l1 d6 K7 I! J% A/ d/ D
<prop key="hibernate.current_session_context_class">
5 u8 L2 |# k! ~9 w4 r+ [# a org.springframework.orm.hibernate4.SpringSessionContext; S- g: s2 l9 S/ f3 M2 E
</prop>
' b1 p8 D0 P8 ^3 Q3 W </props>3 y+ N0 M2 n2 P$ U
</property>& p5 p3 H1 e0 _9 z6 J3 m, p
<property name="mappingResources">' l) j' A6 K2 s& |# T& o2 V+ E
<list>* U* A5 B+ T2 r9 k0 I8 J& A
<value>com/entity.Dept.hbm.xml</value>& i4 T! r9 T9 i
<value>com/entity.Emp.hbm.xml</value>
2 m+ {& _3 F( }4 R$ ?6 ?9 Z </list>! r( q- f) d4 L: F u1 Q& _
</property>
9 e* K: n& E: Y </bean>
$ V% \4 m% B0 D
* _& ^. ]5 y1 ?8 n& O% W' Q <!-- 配置dao层bean -->7 F \+ ]" N* v. e2 P9 {6 j9 i
<bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
% c9 U* w' }: J* f4 i% G <property name="sessionfactory" ref="sessionFactory"></property>& W8 t, y: b* d g9 x0 Q5 y( [
</bean>- b7 c5 I* X O: W
</beans>
* ~* _' _" \; {$ @8 A+ ^
# ?3 v% ~0 {' ~ S+ J不管是用哪种jar包的配置都是这个问题,搞不懂 求解# Z) ], a, x! e$ |
|
|