spring+mybatis+druid+mysql为啥会报:spring xml model Validation 20C

小白小连一下,求各路大神指教:用的idea开发spring+mybatis+druid+mysql
spring+mybatis+druid为啥为啥会报:spring xml model Validation ,
其中加粗字体报spring xml model Validation
而换c3p0不会有spring xml model Validation
我的具体配置如下:
applicationcontext.xml:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

<!--开启注解 -->
<context:annotation-config />
<!--扫包 -->
<context:component-scan base-package="com.cgwllx" />

<!-- 读取jdbc配置 -->
<bean
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <!-- jdbc.properties引入-->
            <value>classpath:jdbc.properties</value>
        </list>
    </property>
</bean>

<!--数据库连接池  druid-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
    <!--读取值 ${key}-->
    <property name="**driverClass**" value="${driverClass}" /> 
    <property name="**jdbcUrl**" value="${jdbcUrl}"></property>
    <property name="**user**" value="${user}" />
    <property name="password" value="${password}" />
</bean>

<!--Mybatis操作数据库 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <!--连数据库 -->
    <property name="dataSource" ref="dataSource" />
    <!--xml位置 -->
    <property name="mapperLocations" value="classpath:com/cgwllx/lxfood/dao/***.xml**" />
    <!--PO别名 -->
    <property name="typeAliasesPackage" value="com.cgwllx.lxfood.dao" />

</bean>

<!-- 扫包 扫xml -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="com.cgwllx.lxfood.dao" />
</bean>



项目结构:
图片说明

jdbc.properties为:
driverClass=mysql.jdbc.Driver

jdbcUrl=mysql://localhost:3306/energizecloud?useUnicode=true&characterEncoding=utf8

user=root

password=1234

pom也引入了该有的依赖:

<!-- spring版本号 -->
4.3.5.RELEASE

        <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.15</version>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>1.0.28</version>
    </dependency>
            <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
    </dependency> 

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>

            <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>3.3.0</version>
    </dependency>

    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>1.2.2</version>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>

3个回答

weixin_43944282
weixin_43944282 我是过了,不行
10 个月之前 回复

数据库连接改成:
jdbcUrl=mysql://localhost:3306/energizecloud?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8

xxfen_
萧萧风 回复weixin_43944282: 再试一下
10 个月之前 回复
xxfen_
萧萧风 回复weixin_43944282: 发报错日志看看
10 个月之前 回复
weixin_43944282
weixin_43944282 试过了,不行
10 个月之前 回复

https://blog.csdn.net/mr_orange_klj/article/details/78814085

是不是要取消xml校验..类似上图..不一定是那个..

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问