如何为camel核心xml解析器启用AccessExternalSchema

问题描述 投票:0回答:1

https://camel.apache.org/manual/camel-3x-upgrade-guide-3_21.html 中发现,camel-core 禁用了对 xml 解析器的外部架构的访问。

我目前在骆驼路线启动中遇到此错误:

Caused by: org.xml.sax.SAXParseException: schema_reference: Failed to read schema document 'so.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.

我现在非常有信心是由此禁用引起的,因为有问题的路由是通过 spring xml 配置的。有谁知道有什么解决方法可以重新启用此功能吗?

旁注由于公司限制,无法分享任何代码细节。我知道这将使回应变得普遍。我会回答任何我能回答的问题。

目前,尝试将spring xml路由配置重写为Java DSL,问题得到解决。然而,理想情况下不希望这样做,因为 spring xml 文件大约有 400 行长,重写将花费大量时间。任何和所有答案/回应都表示赞赏!

java xml spring-boot apache-camel camel-core
1个回答
0
投票

如果您遇到启动camel-config.xml 的问题,请参阅本文。 camel-spring-3.10.0.jar 中缺少camel-spring.xsd

如果运行时出现问题,请尝试将其添加到您的 application.properties 文件中

camel.dataformat.jaxb.access-external-schema-protocols=all
© www.soinside.com 2019 - 2024. All rights reserved.