• 解决通配符的匹配很全面,但无法找到元素'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"/>

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

  • 相关阅读:
    实现servlet的三种方式
    java中的运算符与表达式
    封装链接数据库的工具
    java 概述
    HTTP请求方式中get和post的区别
    asp.net获取当前网址url
    利用IP安全策略关闭危险端口
    IE6 css fixed
    存储过程中使用事务详解
    windows 2003内存性能分析工具
  • 原文地址:https://www.cnblogs.com/future-liu1121/p/7768565.html
Copyright © 2020-2023  润新知