解决方案 »

  1.   

    把斜杠去掉试试:
    <!-- 配置文件加载 -->
        <bean id="propertyConfigure" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>WEB-INF/config/mongoDb.properties</value>
    <value>WEB-INF/jdbc.properties</value>
    </list>
    </property>
    </bean>
      

  2.   

    确定文件的路径没问题的情况下加上
    <bean id="propertyConfigure" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
    <property name="locations">
    <list>
    <value>/WEB-INF/config/mongoDb.properties</value>
    <value>/WEB-INF/jdbc.properties</value>
    </list>
    </property>
    </bean>
      

  3.   

    mongoDb.properties最好放到src里面去
    一般这种配置可以直接写绝对路径,配置文件放到外面
    <value>classpath*:config.properties</value>
    <value>file:D:/config/config.properties</value>
    <value>file:/u01/config/config.properties</value>
      

  4.   

    <context:property-placeholder location="/WEB-INF/jdbc.properties" />
    <property name="driverClassName" value="${jdbc.driver}" />