该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
/ r5 k& `# j! E( g3 x0 e) n+ c, n- zorg.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:3 P- X3 F. W! { V3 Y
7 e' s p! Q2 ]7 y* f8 X& c% v这是我spring配置信息:
* e8 ]! e7 B' f; w# j7 ?1 C4 O' f
4 z0 m6 V* w9 e" S8 e" @. m<?xml version="1.0" encoding="UTF-8"?># b: m$ ] b9 l
<beans xmlns="http://www.springframework.org/schema/beans"
7 H+ Q% r4 i* X# x2 j/ o3 Q xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
0 @2 w* R# H/ @; Q xmlns:aop="http://www.springframework.org/schema/aop"
+ n r4 E: b D$ k7 M xmlns:context="http://www.springframework.org/schema/context"
" b u3 W* m% v1 Y2 q1 c' p& R4 t xmlns:p="http://www.springframework.org/schema/p", `8 W) _) [1 e% o+ K* k F
xmlns:tx="http://www.springframework.org/schema/tx"5 m2 G& S) {: h/ U9 r6 m4 r8 \
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" m. q& x; ~5 k+ R
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
* {0 \! O {0 T http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
' m$ f2 n) l( R3 I http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
6 K* S2 q# A$ w7 M1 I) {. W; X# H( @! M7 d3 q- q i0 b( c; Y' z
<!-- 配置连接池数据源 -->
0 G% X" l$ V* q) Q+ j) ^- X$ r <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">, H0 v Q q; U1 J1 o& o; L
<property name="jndiName">
4 \, H+ o$ I( L( r, Z <value>java:comp/env/jdbc/oracle</value>
# `1 W; Q/ f+ `0 N; E </property>% G! |+ p9 }5 ]) H& R
</bean> -->
+ J0 X( V: M) J6 W0 R1 N( R <!-- 使用外部文件配置数据源 -->
8 Y* N& K" t. { <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">" Y, W. \% s" }6 c+ A5 t8 d
<property name="location">' D/ ?9 E7 f" r& f8 O- `9 z
<value>classpath:jdbc.properties</value>' B5 l- q# l6 S o: ]# F o- `
</property> m- `. Q. F: P" W
</bean>
' G {+ G8 U1 t" ^7 \ <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >( V# \; ~2 l7 Z, h- ?6 b8 k
<property name="driverClassName" value="${driver}"/>
9 K: x; i1 J. ` x! i <property name="url" value="${url}"/>
; G/ r4 Y6 F: N <property name="username" value="${username}"/>, @9 x/ ?+ P4 B& z G8 P
<property name="password" value="${password}"/>
+ q5 g! D/ N0 t" i6 I w </bean>
& B& y3 Y6 ]" E' e
4 o0 Z9 F6 X+ A' h; l% Z <!-- 配置session工厂 -->
/ i* R. }* R \4 _ <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">. a) j' r0 I0 }
<property name="dataSource" ref="Source"></property>2 f, L9 b) V& |# Q: ~
<property name="hibernateProperties">, i( Z7 S Z! r+ f- {
<props>
# M8 _1 e6 M2 j <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>. k4 J; s9 M* i5 r W& |
<prop key="hibernate.current_session_context_class">& K8 g! I9 l" w
org.springframework.orm.hibernate4.SpringSessionContext
2 h Y; ~& Y8 z2 G2 y, | </prop>4 N# n5 B+ L! A
</props>
# T4 i5 T5 _. f; o, E9 P, @ </property>
4 h# @/ O, r6 z+ M1 E/ ?1 ~ <property name="mappingResources">
- F% d$ T' _ ^' n ~. U% V <list>" s* V, ~. I$ b8 N t
<value>com/entity.Dept.hbm.xml</value>
) v- D8 j) y+ E- k. F3 P7 ?4 O: {/ R2 @ <value>com/entity.Emp.hbm.xml</value>6 k- S; \) x) N4 J7 r) U$ [, O
</list>; ~ T3 l% c: x0 E1 U/ G, L& o
</property>1 }0 X. y9 f- z; m, y/ c: u
</bean>) m0 n; j$ X8 ?- A& k, Z
+ @0 J9 \* h0 N, H) \8 P& h' [+ y' U <!-- 配置dao层bean -->
' N4 Q- H* B" j& d, [% ~ <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
5 e2 r* e: L* q( M( u* n( x <property name="sessionfactory" ref="sessionFactory"></property>
0 b3 J2 y* `. u$ H$ F9 p6 C0 n- } </bean>8 [2 R6 L6 j. h* Z; F9 `9 o
</beans>
( x% e" I6 ^. {, p" b( q/ J' @( W
. |( Z/ s7 ~2 C不管是用哪种jar包的配置都是这个问题,搞不懂 求解/ G7 S( I4 e& h; l2 s2 ?7 }
|
|