日期:2014-05-18  浏览次数:22772 次

spring获取数据源dataSource为空null
spring配置文件:
<?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans"   
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"    
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    xsi:schemaLocation="http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd  
    http://www.springframework.org/schema/aop  
    http://www.springframework.org/schema/aop/spring-aop-3.2.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.2.xsd  
    http://www.springframework.org/schema/mvc  
    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd  
    http://www.springframework.org/schema/tx  
    http://www.springframework.org/schema/tx/spring-tx-3.2.xsd" >  
  
    <mvc:annotation-driven />   
      
    <context:annotation-config/>  
      
    <context:component-scan base-package="com.memo.controller" />  
    <context:component-scan base-package="com.memo.dao" />  
  
    <mvc:resources mapping="/img/**" location="/images/" />    
    <mvc:resources mapping="/js/**" location="/javascript/" />    
    <mvc:resources mapping="/css/**" location="/css/" />   
    <mvc:resources mapping="/html/**" location="/html/" />   
      
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">    
        <property name="driverClassName">    
            <value>com.mysql.jdbc.Driver</value>    
        </property>    
        <property name="url">    
            <value>jdbc:mysql://127.0.0.1:3306/memo</value>    
        </property>    
        <property name="username">    
            <value>root</value>    
        </property>    
      &