【问题标题】:JBoss 7 - Could not parse file META-INF/hornetq-jms.xmlJBoss 7 - 无法解析文件 META-INF/hornetq-jms.xml
【发布时间】:2013-02-28 08:14:45
【问题描述】:

我需要在部署 Web 应用程序时配置 JMS 主题。我不得不为此使用部署描述符。 hornetq-jms.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="urn:hornetq" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schemas/hornetq-jms.xsd ">

<connection-factory name="InVmConnectionFactory">
    <connectors>
       <connector-ref connector-name="in-vm"/>
    </connectors>
    <entries>
        <entry name="InVmConnectionFactory"/>
    </entries>
</connection-factory>

<queue name="OrderQueue">
    <entry name="queues/beanQueue"/>
</queue>

</configuration> 

但是在部署过程中我遇到了这样的错误:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element '{urn:hornetq}configuration'

【问题讨论】:

  • 我可能是错的,但我认为你不能在带有 jboss 7 的 meta-inf 上使用 hornetq-jms。你应该使用standalone-full.xml 来处理这些事情现在。
  • @Clebert 我也可以t change parameters in servers config. I need to create topic while deploying the app or maybe in the app but I cant 从正在运行的应用程序中找到如何操作。在 glassfish 中很容易,在 jBoss 7 中很痛苦 :(
  • 您可能应该在 JBoss 用户论坛上提问。他们更擅长回答这个问题。一旦你这样做了,你可以在这里提出问题。
  • 顺便说一句:我认为有一个解决方案......它只是在 AS7 上有所不同,我现在不确定......

标签: jms jboss7.x hornetq jms-topic


【解决方案1】:

正如here 的回答,我使用了 hornetq-jms.xml 的旧语法。 这是正确 hornetq-jms.xml 文件的示例:

<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2012, Red Hat, Inc.
and/or its affiliates, and individual contributors by the @authors tag. See
the copyright.txt in the distribution for a full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<messaging-deployment xmlns="urn:jboss:messaging-deployment:1.0">
    <hornetq-server>
        <jms-destinations>
            <jms-queue name="HELLOWORLDMDBQueue">
                <entry name="/queue/HELLOWORLDMDBQueue"/>
            </jms-queue>
            <jms-topic name="HELLOWORLDMDBTopic">
                <entry name="/topic/HELLOWORLDMDBTopic"/>
            </jms-topic>
        </jms-destinations>
    </hornetq-server>
</messaging-deployment>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 2019-04-18
    • 2012-05-06
    • 2015-03-02
    • 2018-06-12
    • 1970-01-01
    相关资源
    最近更新 更多