|
该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
; m8 _3 k3 g4 ~6 s, Sorg.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:4 T1 o3 _: f0 {- D y. ~
* l6 R+ U9 F# p这是我spring配置信息:
3 |, Q; H9 [) Q$ I4 f8 I
& F2 f) z9 D6 S0 @<?xml version="1.0" encoding="UTF-8"?>- x% \" E% E% q) q) @
<beans xmlns="http://www.springframework.org/schema/beans"5 G+ ~# `5 v O; z/ `% S* b, X2 L
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
0 Z+ w1 {# V+ Y$ S xmlns:aop="http://www.springframework.org/schema/aop"
, `; Z$ [$ D1 I4 }# f xmlns:context="http://www.springframework.org/schema/context"
5 K( X" _; `. |5 N xmlns:p="http://www.springframework.org/schema/p"
+ r% @4 l" j" \: T; M$ `; W. C( Y xmlns:tx="http://www.springframework.org/schema/tx"# M0 d8 e r2 ~' B/ q9 m
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
' {# w0 F$ \6 W! e http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd( \5 Z* F' C `3 Y
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
, h h9 h# G V) X* A# } http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
8 S1 Z5 P6 q: x% {( Q4 I
$ }0 [8 k3 z- u* q <!-- 配置连接池数据源 -->
3 v ^+ n ~* z% K! X <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">4 Z2 v: P* o6 }$ t
<property name="jndiName">" A7 F; g, B5 R6 B, V1 b
<value>java:comp/env/jdbc/oracle</value>
' ?2 L I( J! X [6 { </property>- k" a& [/ {4 w& L
</bean> -->
5 w S# P+ H1 d$ Z <!-- 使用外部文件配置数据源 -->
5 _: l, `$ l3 s8 M/ U" l <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
! [- `0 q1 m6 N <property name="location">
& z2 D5 A4 A2 U7 a9 P/ G8 r <value>classpath:jdbc.properties</value>0 n$ w/ U( @. w) O9 A D
</property>
9 q" C8 h( }% _) j </bean>
+ u% A9 E+ l0 r$ I; ] <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
, O+ {7 K; ~. p& D% n <property name="driverClassName" value="${driver}"/>' r2 F' b$ n% ?# w' z+ I. Y! W. Z
<property name="url" value="${url}"/>
+ k& k4 U$ y# C4 w <property name="username" value="${username}"/>- m& ~% j" d0 y! _
<property name="password" value="${password}"/>
6 X6 j1 s" @" I' c; C# p </bean>
( y/ g8 J+ y' j9 u0 l
( t% {: S0 o; T& E" ^# j <!-- 配置session工厂 -->
: k ~8 A# w: s <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
( s: W& @3 S0 [% {" K <property name="dataSource" ref="Source"></property>
4 p- G5 n& @# q# n( v <property name="hibernateProperties">
, q; T" F( e. Z+ U* c: s9 E <props>( H i' p. M% U" v8 t7 ~, ^2 o5 p
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
3 q2 a& {) k9 z. f <prop key="hibernate.current_session_context_class">1 a6 c# h( v+ `$ Y
org.springframework.orm.hibernate4.SpringSessionContext* @; k& h1 P6 f
</prop>, n& @1 }' g$ I m3 _# y
</props>
8 C8 E8 U! ^& f- H6 p' Z </property>- L$ i" o9 W0 n1 @
<property name="mappingResources">
! _; F. W; C+ I. U ` <list>, O: i! m; D2 {) u5 M7 J
<value>com/entity.Dept.hbm.xml</value>" [: b) L- s- J. j8 e5 [
<value>com/entity.Emp.hbm.xml</value>( V$ V5 |" q5 T) ?
</list>- v6 L w: u. I* Z4 ?" u' x. D4 j5 u
</property>
* F: h, j/ H% [3 V' a' Q3 V </bean>2 U! M# Q0 g2 g! `
( v8 a7 r/ ]2 b) P <!-- 配置dao层bean -->& v2 l1 H( z5 p; y6 R6 S$ x
<bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
9 q/ _' Y% i8 _5 k <property name="sessionfactory" ref="sessionFactory"></property>7 N' | z0 L2 F
</bean>
9 e; p4 g/ j% t) r3 s/ L2 T</beans>
* Z: E/ F* ~ h! w% t/ H1 r6 H% G0 o; p/ J9 }
不管是用哪种jar包的配置都是这个问题,搞不懂 求解
( h# Q9 R3 T3 S |
|