该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
r4 m! q5 e( P' M) a9 e" B {1 ?$ qorg.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:* U* p# E5 H* P+ y
+ S' P' k+ J$ G
这是我spring配置信息:
7 N# u0 O0 F3 j- R
% Z; T+ r& K) W& a8 s3 w/ w( ]<?xml version="1.0" encoding="UTF-8"?>
# R( V% y0 c0 p1 Q<beans xmlns="http://www.springframework.org/schema/beans" A! i7 t6 M" ]; Z# `# a. D7 ^$ g! |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"9 ?4 Q2 N+ u+ e. i% s
xmlns:aop="http://www.springframework.org/schema/aop"
: _) s2 f8 b7 t% v, ]. z) N% d3 \7 E xmlns:context="http://www.springframework.org/schema/context"
! ^; {4 d# U- D9 d3 x6 o$ B xmlns:p="http://www.springframework.org/schema/p"
4 C% ~8 S2 Q0 s4 a( M" p0 S8 e xmlns:tx="http://www.springframework.org/schema/tx"
9 B7 `; [+ x# U2 k+ s, P xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd: \4 U& u8 l) G/ R' m5 l5 R3 s
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd( I( m6 e& ^: ]) L
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
4 S. b0 h" V8 Z" M) Q" T3 R5 C7 j9 w# h http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
# T8 r$ L2 q- H9 I0 n; D9 A* ?! ]6 h& r$ V" v/ x
<!-- 配置连接池数据源 -->
* l% ], m) ^0 B" ~$ q: w& ? <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
4 W+ Q5 ^( _: y% s <property name="jndiName">( L7 w/ h7 G' R
<value>java:comp/env/jdbc/oracle</value>/ t4 F9 I! W$ v6 x/ D9 `, J
</property>, ?! q1 C0 I, y1 R5 C1 P3 F9 Z% f3 @3 y! e
</bean> -->
/ J+ y# q% [* s: ~ <!-- 使用外部文件配置数据源 -->4 R5 K1 A/ c7 Y1 ?6 T- \( q
<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
9 l" Q6 J9 w, L0 q+ ^, ? <property name="location">, b8 G1 c; j" S" d
<value>classpath:jdbc.properties</value>
' s; A$ r, k$ l </property> e6 f7 W4 U, M; Y0 s+ z& g. g
</bean>1 l6 c$ }5 a6 A; {' \, V
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >: {$ W( i+ j; a- c# ~7 q! V0 V
<property name="driverClassName" value="${driver}"/>
! |6 m* T7 }" P/ @! q <property name="url" value="${url}"/>$ Q* C5 {0 r! \/ A3 `6 q( t$ V' \
<property name="username" value="${username}"/>* Z5 k C- B# q" @
<property name="password" value="${password}"/>
+ z1 S: E5 u9 D6 s8 A* A, F </bean>. L5 R1 h/ Z; X+ E$ E
, I& o: }5 E( y8 D {" v <!-- 配置session工厂 -->- W0 T+ ~: w9 Z7 P* C8 |: ^/ @
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
& q9 j: i3 X# q+ J6 U6 U; _$ \ <property name="dataSource" ref="Source"></property>
6 v+ }! x3 `& G; t <property name="hibernateProperties">
! H1 v A( n1 j3 D, v7 D <props>% k( ~6 x+ x; h" z3 j0 V
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
8 N# D0 R3 v4 y& S# r! N7 _7 w7 Z <prop key="hibernate.current_session_context_class">( D% V2 b. ~& u. B, O" Q
org.springframework.orm.hibernate4.SpringSessionContext) Z5 ?/ y2 o' w" T3 ] {# m1 R
</prop>5 k7 m, n! K4 y- ^- R2 x& `
</props>0 |5 ~4 G" u6 t8 L) j5 M! T. a! t+ S. ?
</property>
$ T* a: m- x$ Y( O# ]1 s$ |) k <property name="mappingResources">9 ^5 ]- f3 u- @2 u% p' G: z4 n
<list>6 o4 a4 b( `1 I) ~2 r* E0 v; j W; f
<value>com/entity.Dept.hbm.xml</value>2 a; G) k4 y# f& R3 S
<value>com/entity.Emp.hbm.xml</value>
" F' h _& U! }4 R) I+ W </list>
- i$ x; `6 e0 z O( x! I, M' p+ { </property>
. r3 w4 m2 Q( ?: T3 P( b; H </bean>
. \. T" l! J& @; A
0 `; W' }6 _6 J6 Y1 ` <!-- 配置dao层bean -->
$ @ R. k' |- `0 X* L* z- {3 E <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
- L, H8 e2 g! i2 U3 |4 c <property name="sessionfactory" ref="sessionFactory"></property>
6 x* R7 n, P1 s: j </bean>( ^) X8 e7 c" K& L1 o) @! k
</beans>6 E( ^& f `/ q3 W+ J# S
/ ]3 N" x* @* |/ I; P# ^不管是用哪种jar包的配置都是这个问题,搞不懂 求解* o; j; T$ T4 t' c u) w! t$ y* ~
|
|