|
该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
: ?# ]5 f1 Z" _4 Torg.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:
) [' t: Q0 I0 s+ i+ z
1 J' K$ {) v# [1 ^7 g( Z1 Y这是我spring配置信息:
5 P' z) _) ^7 B# E) w T% g+ l# u0 F7 f! f! u7 I i# b
<?xml version="1.0" encoding="UTF-8"?>7 o1 W" ^# v n; ^$ c# `8 q, p
<beans xmlns="http://www.springframework.org/schema/beans": b. H0 ^5 x! m( d5 Y
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" t- {- |$ k4 t! R; X9 K
xmlns:aop="http://www.springframework.org/schema/aop"& x- d" Y& P2 T9 y! x
xmlns:context="http://www.springframework.org/schema/context"8 ]5 ~. }+ G8 c, [
xmlns:p="http://www.springframework.org/schema/p"9 G# Y& W. G$ g! Y# V
xmlns:tx="http://www.springframework.org/schema/tx") p3 p2 Z. c8 y- i$ b3 u# | F
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
: s% Y) P2 `( n http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd9 `; u' C* s- s( i' Y: f
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
2 S2 ]* `& T8 \. z$ o; d( d http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">5 {' \; @# G$ x* b, W" a8 Q
! n/ h) J2 ?) S1 W <!-- 配置连接池数据源 -->7 p5 S/ c4 ]# b, y2 J3 H! X+ z
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
1 k$ A* M. D2 O6 o- ?9 g3 { <property name="jndiName">9 u* G' q Q8 H0 w9 U4 J
<value>java:comp/env/jdbc/oracle</value>
1 i; \ k0 b3 a/ j- B </property>' \( B5 [+ Z6 h; A! n) e
</bean> -->0 d7 d# E/ \7 M7 K8 O% {
<!-- 使用外部文件配置数据源 -->
' \3 @6 w! e9 U' m3 A4 U <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">: S# M2 E- a `' D0 U; p
<property name="location">
* N, k' W: \" V5 @5 N3 [; J <value>classpath:jdbc.properties</value>( Z3 E2 j0 F" M! c. v$ V
</property>
: W; H$ z. H% l% H: p, f </bean>
/ E8 D; T% r5 \5 p <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >* ?5 r, q/ R- ` u) f% f% h0 t3 _
<property name="driverClassName" value="${driver}"/> X) f# j8 V6 {3 s* l7 e
<property name="url" value="${url}"/>, a- l. w5 ?; o) [
<property name="username" value="${username}"/>9 s! Y5 T, v% S1 o: l! C) R$ F
<property name="password" value="${password}"/>: V) @0 \7 w7 l0 n) ]+ V: G
</bean>
3 y2 o2 z% F* N, }
0 g: u! ~5 Y6 [! p$ S3 _ <!-- 配置session工厂 -->
: A$ p. t/ L1 K; y( a/ u <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"># g8 G( Z7 v1 ~) }/ q, Y
<property name="dataSource" ref="Source"></property>
& [. S* O& V& V) Q# K) }6 q <property name="hibernateProperties">* j! C s7 D0 `
<props>
7 |' f3 ^* E. A' H; \ <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
1 U0 r9 k% l1 ^' ~6 a. w. ? <prop key="hibernate.current_session_context_class">2 g' q; e$ f( X
org.springframework.orm.hibernate4.SpringSessionContext8 ^& {+ @' G' Y8 Z8 e
</prop>
- T" j7 g6 d9 x; y8 g9 i </props>
8 f6 V* l- N+ o8 c </property>
+ e0 V9 p2 a3 C3 E/ ?6 i <property name="mappingResources">' `2 t( D+ V& I+ ~% @9 a2 O
<list>
: z1 h! E+ A7 w# Z4 A) I& q <value>com/entity.Dept.hbm.xml</value>
+ [% z$ U# A x <value>com/entity.Emp.hbm.xml</value>! d3 P0 k$ L! F6 L3 ~8 u
</list>
( `8 E0 K" D2 J8 Q </property>
6 M: }- K6 ? r5 q- V </bean>
5 H. Y$ A" `3 Y
6 j/ G$ H: J- G9 x2 W: o <!-- 配置dao层bean -->
1 \6 s; k" o4 l4 N. M/ w3 o <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">1 o- E- S& t0 c0 i* T
<property name="sessionfactory" ref="sessionFactory"></property>+ V4 f: V$ M b- w7 S$ n
</bean>. b5 d7 a$ ~, d1 e$ u
</beans>% [5 _ s. O. v
/ o. J+ c9 W2 v( k. c4 {) E3 z* P
不管是用哪种jar包的配置都是这个问题,搞不懂 求解' D- Q& H) I" B
|
|