Spring + Maven: The matching wildcard is strict, but no declaration can be found for element 'jdbc:embedded-database'

时光总嘲笑我的痴心妄想 提交于 2019-12-03 11:22:28

This line in your Spring context file:

xmlns:jdbc="http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd"

should be changed to :

xmlns:jdbc="http://www.springframework.org/schema/jdbc"

Not sure what IDE you're using but with some (IntelliJ for example) this would be flagged as an error and save a lot of headache!

For me it was to add xmlns:jdbc and xsi:schemaLocation

<beans ....

    xmlns:jdbc="http://www.springframework.org/schema/jdbc"

    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    .....
    http://www.springframework.org/schema/jdbc
    http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"
    default-lazy-init="true">

also add

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!