zoukankan      html  css  js  c++  java
  • 解决通配符的匹配很全面,但无法找到元素'context:property-placeholder‘的声明

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans.xsd">
        <!--配置整合mybatis过程-->
        <!--1:配置数据库相关参数-->
        <context:property-placeholder location="classpath:jdbc.properties"/>

    当开始的时候,spring-dao.xml文件中的头部是这样的时候,就会报:

    通配符的匹配很全面,但无法找到元素‘context:property-placeholder‘的声明

    这样的错误,经过查阅资料和上网查后,发现是没有在上面的配置文件中配置关于context的相关解析文件,故报此错,当我们在w文件的头部添加解析文件之后如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://www.springframework.org/schema/context
                    http://www.springframework.org/schema/context/spring-context-4.2.xsd">
        <!--配置整合mybatis过程-->
        <!--1:配置数据库相关参数-->
        <context:property-placeholder location="classpath:jdbc.properties"/>

    如上红色字体显示的那样,就会解决该问题。

  • 相关阅读:
    理解和解决MySQL乱码问题
    搞清字符集和字符编码
    linux下卸载mysql
    mysqldump备份
    mysql 数据类型
    微信对接HIS——微信可查检验结果
    Install Haskell on Ubuntu and CentOS
    php用类生成二维码
    UVA Team Queue
    总有一种正能量触动你的心灵,读刘丁宁的一封信
  • 原文地址:https://www.cnblogs.com/future-liu1121/p/7768565.html
Copyright © 2011-2022 走看看