gpt4 book ai didi

java - 是否可以在 XInclude 属性 href 中使用 Java 系统属性变量?

转载 作者:行者123 更新时间:2023-12-02 09:26:13 24 4
gpt4 key购买 nike

我正在使用 ActiveMQ Artemis splitbroker.xml 功能并包含 xml 文件。我正在尝试使用 Java 系统属性作为 xml 文件路径。但它抛出错误。

这是我正在尝试的线路。

<xi:include href="${amq.conf.broker.config}/broker-security-settings.xml"/>

我单独定义了-Damq.conf.broker.config=/var/amq/...

出现以下错误

[Fatal Error] :116:82: An include with href '${amq.conf.broker.config}/broker-security-settings.xml'failed, and no fallback element was found.
org.xml.sax.SAXParseException; lineNumber: 116; columnNumber: 82; An include with href '${amq.conf.broker.config}/broker-security-settings.xml'failed, and no fallback element was found.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.apache.activemq.artemis.utils.XMLUtil.readerToElement(XMLUtil.java:84)
at org.apache.activemq.artemis.utils.XMLUtil.streamToElement(XMLUtil.java:57)
at org.apache.activemq.artemis.utils.XMLUtil.urlToElement(XMLUtil.java:66)
at org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:70)
at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:61)
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:85)
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:150)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:98)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49)
java.lang.NullPointerException
at org.apache.activemq.artemis.integration.FileBroker.getServer(FileBroker.java:131)
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:112)
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:150)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:98)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49)

最佳答案

ActiveMQ Artemis 目前不支持在 include 元素的 href 中使用系统属性替换。然而,这似乎是一个不错的功能,所以我打开了 a new JIRA并发送 a PR .

关于java - 是否可以在 XInclude 属性 href 中使用 Java 系统属性变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58323141/

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