需要帮助在 JBoss EAP standalone-full.xml 中使用多个选项配置 ActiveMQ URL

Need help configuring ActiveMQ URL with multiple options in JBoss EAP standalone-full.xml

在我的 JBoss EAP 7.0.x 独立 full.xml 中,我有一个 ActiveMQ 资源适配器,我将 ActiveMQ 连接放在其中 URL。我的ActiveMQ连接URL有多个选项,根据ActiveMQ语法,&是用来连接选项的。例如:

故障转移:(tcp://localhost:61616)?startupMaxReconnectAttempts=15&jms.useCompression=true

当我启动 JBoss 服务器时,它抛出了以下异常:

11:13:19,593 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
    at org.jboss.as.server.ServerService.boot(ServerService.java:362)
    at org.jboss.as.controller.AbstractControllerService.run(AbstractControllerService.java:301)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'jms.useCompression'
 at [row,col {unknown-source}]: [407,107]
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.readElement(ResourceAdapterSubsystemParser.java:461)
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.readElement(ResourceAdapterSubsystemParser.java:123)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
    at org.jboss.as.server.parsing.StandaloneXml_4.parseServerProfile(StandaloneXml_4.java:546)
    at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:242)
    at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:141)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:103)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:49)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
    ... 3 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'jms.useCompression'
 at [row,col {unknown-source}]: [407,107]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:647)
    at com.ctc.wstx.sr.StreamScanner.parseEntityName(StreamScanner.java:2066)
    at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(StreamScanner.java:1525)
    at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4701)
    at com.ctc.wstx.sr.BasicStreamReader.readCoalescedText(BasicStreamReader.java:4146)
    at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:683)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.getElementText(XMLExtendedStreamReaderImpl.java:144)
    at org.jboss.as.connector.util.AbstractParser.rawElementText(AbstractParser.java:61)
    at org.jboss.as.connector.subsystems.resourceadapters.CommonIronJacamarParser.parseConfigProperties(CommonIronJacamarParser.java:121)
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterParser.parseResourceAdapter(ResourceAdapterParser.java:311)
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterParser.parseResourceAdapters(ResourceAdapterParser.java:138)
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterParser.parse(ResourceAdapterParser.java:104)
    at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.readElement(ResourceAdapterSubsystemParser.java:452)
    ... 14 more

11:13:19,595 FATAL [org.jboss.as.server](控制器引导线程)​​WFLYSRV0056:服务器引导以不可恢复的方式失败;退出。有关详细信息,请参阅以前的消息。

不知道有没有人遇到并解决了这个问题?

您需要使用 & 而不是像下面那样只使用“&”:

failover:(tcp://localhost:61616)?startupMaxReconnectAttempts=15&jms.useCompression=true