该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助 }( O5 O2 u) A$ b/ n
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:
# a+ A) ^( R- O& {
u( r, o3 ~4 i1 U1 L) Y u; @这是我spring配置信息:
3 j" L* Q% `/ O; o6 Z9 l1 i( u1 s, I8 X& |- B
<?xml version="1.0" encoding="UTF-8"?>
z% Q# c8 d( T; F9 A* r! F<beans xmlns="http://www.springframework.org/schema/beans"# v( W/ W2 l% v, `
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"3 n+ g- S/ G I$ m' b4 R# l1 V
xmlns:aop="http://www.springframework.org/schema/aop"
3 R; h7 G( {' w1 f; U: ^& V xmlns:context="http://www.springframework.org/schema/context". G- t, Q' C. V6 n0 m9 E
xmlns:p="http://www.springframework.org/schema/p"
2 ?5 O) P- j% l, d! b6 j xmlns:tx="http://www.springframework.org/schema/tx"" L; L1 Q0 j+ M) h. a
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
" W y1 K s5 N4 o http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
; `9 ~1 y' Y- X http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
X' h r+ c# z2 X$ X; K http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
$ j! T7 _, U l: `1 j- m* _. L" [5 J% }
<!-- 配置连接池数据源 -->$ ]% H' V# p4 l& |" Z: r
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
0 z+ [* m7 l$ t) p2 W, R0 Z <property name="jndiName">
6 v8 \, e9 l1 v0 a; W- `" y <value>java:comp/env/jdbc/oracle</value>
5 c0 { X+ Z4 x9 }. V# s$ D/ A </property>2 Y3 m+ Z; i$ |2 B* c
</bean> --> Q2 Y. R# M4 \/ v. \7 d, D
<!-- 使用外部文件配置数据源 -->
* q: e) i* r1 h7 K# u P4 M. ^ <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
( n" f2 j9 o" t; f <property name="location">/ P' T7 W5 x* K+ f' r- G3 s0 a
<value>classpath:jdbc.properties</value>6 \( {1 L( J0 {" j# I
</property>
8 s( F: K- F6 X/ S2 s9 l1 n </bean>
- Y! |0 y/ q6 {! B <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >: n; o2 }8 n: d$ I5 d. m
<property name="driverClassName" value="${driver}"/>- F7 G, Z! A8 [3 f: s
<property name="url" value="${url}"/>
& Z, P5 `( d8 z2 ^1 d8 t% z <property name="username" value="${username}"/>
% L, \1 G/ p8 h <property name="password" value="${password}"/>
0 ~# f# Q T" P4 w x+ |7 h </bean>% z0 J" E3 L6 E( j7 {. k. I4 t
: Y& A* k2 }3 X; k3 a; p' j6 b <!-- 配置session工厂 -->
& P' T( T- p9 p, b7 ] <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
$ w! \. A. U% P3 k <property name="dataSource" ref="Source"></property>- a1 `$ [8 c# R; Q4 ]7 a
<property name="hibernateProperties">. t9 x2 k/ x0 s
<props>
* C+ F" n0 L2 V( @! S, C& X <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>. O5 c e, a/ L+ [
<prop key="hibernate.current_session_context_class">7 ^! H9 D- M, R
org.springframework.orm.hibernate4.SpringSessionContext+ `& J9 S+ e' V' C$ E9 D; G+ U( D/ n( ~
</prop>
6 R: A% {, q; c+ w( t0 Q </props>3 K! c$ d- B$ A6 X
</property># n9 Y5 W) d0 A& ]5 J% Z# J
<property name="mappingResources">! w- Z& S8 {: s* M+ |
<list>
- j; t8 s( F6 a: ^4 I1 X, O <value>com/entity.Dept.hbm.xml</value>
3 e2 m5 _" H8 k' S4 |& Q& Q; D. D& I <value>com/entity.Emp.hbm.xml</value>" M& c- }* _" m6 ~( p1 W* z/ I7 r
</list>" u/ V- M0 D' x" M7 G1 ` t
</property>
. i5 P+ Z/ x6 O4 [: ?6 G( u </bean>$ @- S, [$ {. |# Y3 R
7 u: G8 u& c! S, P: Q: O <!-- 配置dao层bean -->
+ M8 }% T) l; Y5 C- { <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
) L1 B, O" v! P6 s' K7 r( v <property name="sessionfactory" ref="sessionFactory"></property>
@. s E. D; ^0 D </bean>- W4 Q8 [1 o) x* m9 T. [$ G/ _
</beans>
+ G, r+ m$ `2 \* \9 X- m' W' c. ^$ u1 b: E! t
不管是用哪种jar包的配置都是这个问题,搞不懂 求解; ]4 J& J& j1 @ G" S. U: S
|
|