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"/>

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

  • 相关阅读:
    层叠
    属性值的计算过程
    HTML+CSS笔记1-杂
    C语言—栈
    C语言零碎知识点
    线性表,顺序表,链表,数组的区别与联系
    C语言—单链表
    转载——从机器学习谈起
    readonly和const关键字
    C#中的扩展方法
  • 原文地址:https://www.cnblogs.com/future-liu1121/p/7768565.html
Copyright © 2011-2022 走看看