【问题标题】:Failed to read CouchDb schema from classpath无法从类路径读取 CouchDb 架构
【发布时间】:2017-10-01 16:53:32
【问题描述】:

我正在使用本指南通过 Spring-boot 配置 CouchDb:link。当这个 XML 配置文件出现问题

<?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:couchdb="http://www.ektorp.org/schema/couchdb"
xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.ektorp.org/schema/couchdb http://www.ektorp.org/schema/couchdb/couchdb.xsd
">

 <couchdb:database name="myDatabase" url="http://localhost:5984"/> 


</beans>

无法验证,因为无法读取 ektorp xml 架构。当我通过浏览器链接检查其架构时,没有,但在 maven 依赖项中肯定有一个。但是当我切换这条线时

http://www.ektorp.org/schema/couchdb/couchdb.xsd

进入

classpath:couchdb.xsd

它也不会被读取,即使它位于名为 couchdb.xsd 的 maven 依赖项之一中。 (您可以在github 上检查该文件)。

如何强制 XML 阅读器查看 maven 依赖项以找到正确的架构文件?

【问题讨论】:

  • 既然您遇到了 XML 配置问题,那么 XML 配置是强制性的还是您可以使用 Spring-Bean Config 类进行配置?
  • 最好用 XML 配置它。无论如何,我解决了问题,看看答案。

标签: java xml maven xsd ektorp


【解决方案1】:

这个问题和其他由于 Eclipse 的错误一样令人讨厌。我刚刚删除了配置文件并重新创建了它,但是 没有验证 xml 架构,一切正常。

附:问题中的配置是正确的,无需从本地 maven 存储库(即从类路径)中提取 xml 模式。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-10
    • 1970-01-01
    • 2015-11-14
    • 2012-05-12
    • 1970-01-01
    • 2013-09-18
    • 2012-10-11
    • 1970-01-01
    相关资源
    最近更新 更多