该用户从未签到
|
今天刚换了4的版本就报错,纠结啊,求助
$ }" N$ _1 C Y$ z: e ?, norg.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:
+ y7 C2 F' ?+ K" H9 t: ]7 P
5 _/ f7 w+ n3 k9 X- M2 A4 B这是我spring配置信息:
5 ?% {6 l! B7 d' ^2 C" P2 N2 R4 M' e
4 z# U- z# C6 Y4 O/ p: c( t<?xml version="1.0" encoding="UTF-8"?>4 O- _1 H, m1 {8 Q! J
<beans xmlns="http://www.springframework.org/schema/beans"
" Q: d3 Z$ }7 ^" i$ q2 B8 B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
# H, C1 _* B" d0 Q" R xmlns:aop="http://www.springframework.org/schema/aop"7 V8 V6 a! c3 B" q/ U+ l* A6 @
xmlns:context="http://www.springframework.org/schema/context"
% h4 D) p/ m$ k# d, @: U xmlns:p="http://www.springframework.org/schema/p"6 P) ~9 a+ a6 R
xmlns:tx="http://www.springframework.org/schema/tx"
0 |; E0 i3 v2 m4 c/ }5 {3 f xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
3 h3 R8 j' ` M: F1 v% K% Z! P; U http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
8 U) ^$ v0 i7 s9 y! D6 G http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-4.0.xsd
# P& w5 r% W. z% o. P http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">6 `( a% h% Z& D
* K& n* y! @0 A# p <!-- 配置连接池数据源 -->; u* q5 Z# y7 I3 F& U( q
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">/ c% T4 F% u' C& D2 R2 [' `) x
<property name="jndiName">
- ?; [) Y2 k' Y, f: q <value>java:comp/env/jdbc/oracle</value>
6 I0 J. E8 J& s0 |( |* {& l, j </property>
0 |6 c8 u3 ^- f0 F0 ] </bean> -->9 l; p2 z9 Q# w) C
<!-- 使用外部文件配置数据源 -->
$ y9 q/ Y, v' A5 J <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">1 D0 W- \' [, | D7 `- `& o& I+ c% |
<property name="location">
# k7 }" J9 X! x0 C9 d: S8 U8 K! A <value>classpath:jdbc.properties</value>
/ v; o2 U$ M, B9 v" e% j6 q* u </property>
6 }4 p0 t& ]+ I" S3 Q4 ~7 F9 |$ y </bean>
3 ]# J3 B1 s- h- _6 f7 d5 p <bean id="Source" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
2 V7 ] n' P( ] <property name="driverClassName" value="${driver}"/>: p4 M, I- z [1 T6 T
<property name="url" value="${url}"/>
6 P1 E5 G u( u! ~ f <property name="username" value="${username}"/>
$ y& d; l; ^9 {1 }; v& x+ G <property name="password" value="${password}"/>1 Q- C8 A1 q6 u# @3 e4 u
</bean>
: f( b. p3 S1 O3 D
1 v" b9 _2 p$ |; s- D <!-- 配置session工厂 -->
$ s, S8 J( D8 X <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
1 R8 p4 m- {' Z4 W* o <property name="dataSource" ref="Source"></property>8 r( [8 c2 r( D5 C5 l' r
<property name="hibernateProperties">7 d/ a+ D+ t% E z0 Y- H# i
<props>
! |/ O. ?7 t1 I. X5 A" l" Z <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>) Y; p* u. G4 C9 M
<prop key="hibernate.current_session_context_class">% M! I( b( X! q' T% A2 ?" l/ h
org.springframework.orm.hibernate4.SpringSessionContext/ ^0 @! p: ~* D$ {
</prop>
0 X7 A& I8 w- z2 G1 Q0 h </props>
* d0 o% w: p+ [2 r) }* O </property>0 |9 s, l5 ]0 Q, X x6 w
<property name="mappingResources">9 d5 ~# b2 q# J) {/ }3 \
<list>
! o1 {# x5 a0 z0 [ <value>com/entity.Dept.hbm.xml</value>
5 v0 {: ^. @" i- ^5 w <value>com/entity.Emp.hbm.xml</value>' h( E" n: a. U! o8 @6 B5 L
</list>0 L/ v5 h$ m' w2 z4 Z
</property>& D/ _8 \) ?/ ^9 b
</bean>
7 Y1 r8 ~. V6 \% F4 N8 w+ K0 u9 _
/ Y r! `- V5 m4 p5 s6 Q* [ <!-- 配置dao层bean -->) N' o) [3 [0 K# k4 I; ^
<bean id="staffDao" class="com.Dao.Impl.StaffDaoImpl">
, s# a' w3 c \* y! Y <property name="sessionfactory" ref="sessionFactory"></property># \3 h+ l. E5 N( k8 V3 J4 q( f
</bean>9 h6 l e6 m$ B5 c, g. G
</beans>8 Y9 i2 d; i4 U7 G
8 _; T' h- ?+ R
不管是用哪种jar包的配置都是这个问题,搞不懂 求解' r6 F( K/ u9 h& u/ k" C. S
|
|