该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
x2 H( }1 r4 {) W0 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:
. {9 K2 x5 ]* B9 c0 \7 O5 I7 Y8 o' f/ S6 l& [
这是我spring配置信息:: q( F" o4 k3 o) N l2 d
. i8 B6 i! Z, v; t5 X j- z5 |<?xml version="1.0" encoding="UTF-8"?>) D5 w6 ~6 Z( a2 S
<beans xmlns="http://www.springframework.org/schema/beans"$ Z" C y4 q1 u! I6 l
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"$ G7 J# P, T% J( |0 X; m5 B
xmlns:aop="http://www.springframework.org/schema/aop". w" [% a/ u4 g3 j' T
xmlns:context="http://www.springframework.org/schema/context"2 o* {* R8 c3 @: F4 q: J
xmlns:p="http://www.springframework.org/schema/p"
/ D/ c3 R/ \7 v, j( s6 [6 |) u8 d. _ xmlns:tx="http://www.springframework.org/schema/tx"
( s+ f% e) Q" D) W- t* T" Z xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
, q+ o" \; F9 H9 ?7 G# U; y http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd$ F% m2 L' }" O- T; e( E1 _
http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd' }8 V1 m/ Y' U9 b" [2 w, q3 j9 ^4 d
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">1 ?+ l- ?, j4 l$ q% D
2 q. k$ j( p+ n2 m- L5 i
<!-- 配置连接池数据源 -->
3 m I2 e" V6 z4 `+ e6 I7 b <!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">3 W: m5 t0 H+ N5 N. B
<property name="jndiName">
9 B0 F, E: A! v# y/ X <value>java:comp/env/jdbc/oracle</value>1 j$ @0 D3 c( t; m
</property>) J H- x: j, C) x9 Z! f K4 I
</bean> -->( X8 ?" S: e3 R7 [
<!-- 使用外部文件配置数据源 -->
' x9 {. K: l+ u' }% D <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">+ Y( l. ~2 h8 A, _
<property name="location">
! J) w4 T4 L, J* j2 E& Q2 a <value>classpath:jdbc.properties</value>
" z! S7 n$ e% K# s5 C$ X. P9 } </property>
/ ~3 t4 v( s& A5 D' M6 g </bean>4 [" a- U3 a$ C5 N2 g
<bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
8 N5 L7 c! j" W" z3 d6 K9 x <property name="driverClassName" value="${driver}"/>
( s/ T7 r( G; ]- p. X1 x <property name="url" value="${url}"/>
7 H& k. s: k ^4 h <property name="username" value="${username}"/>
& j2 H- |$ r$ d! u; d+ T <property name="password" value="${password}"/>
5 Z1 D Y$ u9 H6 t6 t0 f! T </bean>
- ^1 V: k8 p! I: W" Q' U- u
& M9 A6 r& I/ E. q. N) m <!-- 配置session工厂 -->
/ j9 K6 A; Q' w! i; v <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
4 c, n2 W+ @$ V" ~3 S9 D <property name="dataSource" ref="Source"></property>
* i6 C% w7 ?" n0 M <property name="hibernateProperties">
8 y( L9 T }) X' S0 T <props>1 z+ D/ x% E' G& \ l
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
5 c7 i3 x q- j; e9 b8 e <prop key="hibernate.current_session_context_class">& g- d3 a% y' l8 j5 G
org.springframework.orm.hibernate4.SpringSessionContext$ V7 \8 s8 I& L p" u# X5 O
</prop>
$ n2 p8 L1 a7 W* z </props>
7 r+ \4 |( a5 U1 ~5 _ o$ ^+ ` </property>$ g+ y% b* @- v3 Q4 `# ` N
<property name="mappingResources">
$ N& j- S0 J k0 | <list>
/ x0 F. T! e2 s+ f) g; Q; C) _ <value>com/entity.Dept.hbm.xml</value>5 D, l+ X5 A) d
<value>com/entity.Emp.hbm.xml</value>
# O: W. J* e! n9 G ~3 g </list>* L' x/ u# j( g: ^+ L" J
</property>9 T# c+ D6 h* b+ V, E0 Q9 B
</bean>
B8 L( R% _ a4 G& e# i
6 T7 H5 C1 U/ L4 \; n <!-- 配置dao层bean -->
- b8 ?/ H% V8 c U8 F <bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">' g7 B5 g/ T9 \$ D4 i
<property name="sessionfactory" ref="sessionFactory"></property>+ Y' j$ C* u/ q3 H# n- ~. k4 D
</bean>( G4 p& u& A" o5 O& y3 q- z
</beans>& v- V' g; k6 T& n& s& A2 a
- U: t" [8 }3 x+ P4 S% T不管是用哪种jar包的配置都是这个问题,搞不懂 求解7 x/ n. b4 A/ U- c$ R) I
|
|