gpt4 book ai didi

java - 一个模式不能包含两个同名的全局组件

转载 作者:行者123 更新时间:2023-12-01 09:38:51 36 4
gpt4 key购买 nike

我收到此错误

Referenced file contains errors (project-aware://go-ontology/org/springframework/beans/factory/xml/spring-beans-3.1.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."   gorules-ontology-beans.xml  /go-ontology/src/main/resources line 1  XML Problem

当我检查“更多详细信息”时,它会提供以下信息:

The errors below were detected when validating the file "spring-beans-3.1.xsd" via the file "gorules-ontology-beans.xml".  In most cases these errors can be detected by validating "spring-beans-3.1.xsd" directly.  However it is possible that errors will only occur when spring-beans-3.1.xsd is validated in the context of gorules-ontology-beans.xml.


sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.springframework.org/schema/beans,identifiedType'.

gorules-ontology-beans.xml

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd
">

<neo4j:repositories base-package="pl.polsl.lstypka.gorules.ontology.reporitory" />

</beans>

我不太擅长java,我找到了一些解决方案,但它不起作用。有人可以帮忙吗?

最佳答案

以下是我使用 Saxon 运行此验证时发生的情况(使用命令行 -t 选项生成输出):

Saxon-EE 9.7.0.7J from Saxonica
Java version 1.6.0_27
Using license serial number V000006
Schema checking successful. Time: 0ms. Memory: 3Mb.
Using parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
Processing file:/Users/mike/Desktop/temp/test.xml
URIResolver.resolve href="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" base="file:/Users/mike/Desktop/temp/test.xml"
Loading schema document http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
Finished loading schema document http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
URIResolver.resolve href="http://www.springframework.org/schema/context/spring-context-3.0.xsd" base="file:/Users/mike/Desktop/temp/test.xml"
Loading schema document http://www.springframework.org/schema/context/spring-context-3.0.xsd
Warning at xsd:import on line 11 column 153 of spring-context-3.0.xsd:
The schema document at http://www.springframework.org/schema/beans/spring-beans-3.0.xsd is
not being read because schema components for this namespace are already available. To
force the schema document to be read, set --multipleSchemaImports:on
URIResolver.resolve href="http://www.springframework.org/schema/tool/spring-tool-3.0.xsd" base="http://www.springframework.org/schema/context/spring-context-3.0.xsd"
Loading schema document http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
Finished loading schema document http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
Finished loading schema document http://www.springframework.org/schema/context/spring-context-3.0.xsd
URIResolver.resolve href="http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd" base="file:/Users/mike/Desktop/temp/test.xml"
Loading schema document http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd
URIResolver.resolve href="http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd" base="http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd"
Loading schema document http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd
Warning at xsd:import on line 11 column 87 of spring-repository-1.0.xsd:
The schema document at http://www.springframework.org/schema/context/spring-context.xsd is
not being read because schema components for this namespace are already available. To
force the schema document to be read, set --multipleSchemaImports:on
Finished loading schema document http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd
Finished loading schema document http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd
Validation time: 368ms. Memory: 15Mb.
Validation successful

这些警告的意思是,在架构文档层次结构中的某个位置,有两个对具有相同命名空间的架构的引用(它可能是也可能不是所引用的相同的实际架构文档,并且该引用可能是也可能不是相同的实际 URL)。 Saxon 猜测第二个引用可以被忽略,因为它可能是相同的模式文档,在这种情况下,Saxon 似乎猜测正确,因为不同的处理器(你的)采取了不同的决定,遵循两个引用,并结束结果是同一组件的多个定义。

关于java - 一个模式不能包含两个同名的全局组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38615548/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com