论坛首页 Java企业应用论坛

spring配置文件版本问题导致的set方法注入无效

浏览 2342 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-06-11  
本人所在的项目组从事SAAS开发,偶尔间发现了一个问题,Spring配置文件版本问题导致set方法注入为空,Spring为1.x时配置文件版本声明采用DTD声明,2.x采用schema声明,平台仅仅将Spring包进行了升级,而配置文件未升级,导致整个set方法在2.x下声明而在1.x获取时为空,整个依赖注入产生许多问题,解决方法升级配置文件版本。
1.x
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"  "http://www.springframework.org/dtd/spring-beans.dtd">
2.x
<?xml version="1.0" encoding="GB2312"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
default-autowire="byName">
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics