首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >是否可以在XInclude属性href中使用Java系统属性变量?

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

Stack Overflow用户
提问于 2019-10-10 20:41:39
回答 1查看 199关注 0票数 0

我正在使用ActiveMQ Artemis split broker.xml功能并包含xml文件。我正在尝试将Java系统属性用于xml文件路径。但这是抛出错误。

这就是我正在尝试的线路。

代码语言:javascript
运行
复制
<xi:include href="${amq.conf.broker.config}/broker-security-settings.xml"/>

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

获取以下错误

代码语言:javascript
运行
复制
[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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-10 21:49:20

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58323141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档