尝试验证espn.raml时出现以下错误。相同的代码适用于gmail.raml。为什么会这样?供您参考,我已经包含了我发现 SchemaFactory 包含的 jar 的结果。
$ 查找 *.jar | xargs grep SchemaFactory.class 二进制文件
axiom_1.2.11.wso2v6.jar 匹配二进制文件
org.apache.openjpa_2.2.0.wso2v1.jar 匹配二进制文件
solr_5.2.1.wso2v1.jar 匹配
这是我得到的例外:
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.validation.SchemaFactory.newSchema(Ljavax/xml/transform/Source;)Ljavax/xml/validation/Schema;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/raml/parser/rule/SchemaRule, and the class loader (instance of <bootloader>) for resolved class, javax/xml/validation/SchemaFactory, have different Class objects for the type m/Source;)Ljavax/xml/validation/Schema; used in the signature
at org.raml.parser.rule.SchemaRule.doValidateValue(SchemaRule.java:118)
at org.raml.parser.rule.SchemaRule.doValidateValue(SchemaRule.java:48)
at org.raml.parser.rule.DefaultTupleRule.validateValue(DefaultTupleRule.java:108)
at org.raml.parser.visitor.YamlDocumentValidator.onScalar(YamlDocumentValidator.java:115)
at org.raml.parser.visitor.NodeVisitor.visitScalar(NodeVisitor.java:256)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:222)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitDocument(NodeVisitor.java:209)
at org.raml.parser.visitor.YamlValidationService.validate(YamlValidationService.java:65)
at org.raml.parser.visitor.YamlValidationService.validate(YamlValidationService.java:95)
at org.raml.parser.visitor.YamlValidationService.validate(YamlValidationService.java:82)
at org.raml.parser.visitor.YamlValidationService.validate(YamlValidationService.java:72)
at org.wso2.carbon.registry.custom.extensions.handlers.utils.RAMLProcessor.isValidateRAML(RAMLProcessor.java:127)
at org.wso2.carbon.registry.custom.extensions.handlers.utils.RAMLProcessor.processRAML(RAMLProcessor.java:79)
at org.wso2.carbon.registry.custom.extensions.handlers.RAMLMediaTypeHandler.put(RAMLMediaTypeHandler.java:157)
at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2503)
... 78 more