在启动wildfly 10.1与artemis一起使用时,未安装jboss.ra.activemq-ra错误仍然存​​在 [英] while starting wildfly 10.1 to work with artemis, jboss.ra.activemq-ra is not installed error persists

查看:136
本文介绍了在启动wildfly 10.1与artemis一起使用时,未安装jboss.ra.activemq-ra错误仍然存​​在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试应用适当的配置,以便能够通过wildfly(也是其他环境成员)在artemis服务器上使用远程消息传递系统 首先,我在本地( https://docs.jboss.org/author/display/WFLY10/Connect+a+pooled-connection-factory+to+a+Remote+Artemis+Server 因此,这是套接字绑定组:

I try to apply appropriate configuration to be able to use remote messaging system on artemis server through wildfly (also other environment members) Firstly, i installed a standalone artemis server(2.0) on my local ( https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/2.0.0/apache-artemis-2.0.0-bin.zip&action=download ) Then i defined an example queueu on it. (exampleQueue) I changed the standalone.xml file according to informations on https://docs.jboss.org/author/display/WFLY10/Connect+a+pooled-connection-factory+to+a+Remote+Artemis+Server So, here is socket-binding-group:

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
    ...
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
    <outbound-socket-binding name="remote-artemis">
        <remote-destination host="localhost" port="61616"/>
    </outbound-socket-binding>
</socket-binding-group>

适应性消息传递子系统定义(之前已包含嵌入式active-mq定义和队列/主题)

adapted messaging subsytem definition (had comprised embedded active-mq definitions and queues / topics before)

        <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        <server name="default">
            <remote-connector name="remote-artemis" socket-binding="remote-artemis"/>
            <in-vm-connector name="in-vm" server-id="0"/>
            <http-acceptor name="http-acceptor" http-listener="default"/>
            <http-acceptor name="http-acceptor-throughput" http-listener="default">
                <param name="batch-delay" value="50"/>
                <param name="direct-deliver" value="false"/>
            </http-acceptor>
            <pooled-connection-factory name="remote-artemis" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory java:/ConnectionFactory" connectors="remote-artemis" transaction="xa" user="s3artemisuser" password="s3artemispass"/>
        </server>
    </subsystem>

我还尝试包括实质上在远程artemis上定义的队列的jndi地址,以便能够通过注入jndi资源从wildfly进行访问. (遵循此文档: https://activemq.apache.org /artemis/docs/1.0.0/using-jms.html )

I also tried to include queues' jndi addresses essentially defined on remote artemis to be able to access from wildfly via injecting jndi resources. (followed this doc : https://activemq.apache.org/artemis/docs/1.0.0/using-jms.html )

    <subsystem xmlns="urn:jboss:domain:naming:2.0">
        <bindings>
            <external-context name="java:global/jms" module="org.jboss.as.naming" class="javax.naming.directory.InitialDirContext" cache="true">
                <environment>
                    <property name="java.naming.factory.initial" value="org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"/>
                    <property name="connectionFactory.ConnectionFactory" value="tcp://localhost:5445"/>
                    <property name="java.naming.security.principal" value="s3artemisuser"/>
                    <property name="java.naming.security.credentials" value="s3artemispass"/>
                </environment>
            </external-context>
        </bindings>
        <remote-naming/>
    </subsystem>

我已将jndi的所有资源injectin临时更改为test(用于生产者和消费者类),以不再引用远程队列/主题.

I have changed all resources injectin by jndi -temporarily to test- (which are used in producer and consumer classes)to refer remote queues/topics anymore.

class MyProducer extends BaseProducer {    
@Resource(mappedName = "java:/global/jms/exampleQueue")
private Queue aQueue;
...
public abstract class BaseProducer extends JpaService {

@Resource(mappedName = "java:/ConnectionFactory")
protected ConnectionFactory connectionFactory; ... }

当我使用这些配置启动Wildfly时,服务未正确部署.尽管我在我的部署文件夹下提供了activemq-rar-5.14.0.rar文件,但是仍然发生相同的错误.我在这里缺少什么,适合我的情况的正确配置是什么?

When i start the wildfly with these configurations, services are not being deployed properly. Although i provide the activemq-rar-5.14.0.rar file under my deployment folder, still same error occurs. What am i missing here, what is the right configuration for my situation ?

10:19:13,701 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "my-module-using-jms-ear-2.0-SNAPSHOT.ear")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.ra.activemq-ra"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [

推荐答案

尽管我认为我的情况与您要达到的目标并不十分相似,但作为比较它可能会很有用. (并且由于您在

Although I don't think my situation is really similar to what you're trying to achieve, it might prove useful as a comparison. (And since you asked for the details at JMS Bridge Between WildFly 10 Artemis and ActiveMQ 5.14 (ONCE_AND_ONLY_ONCE Quality of Service) I'll gladly postit here)

在我的情况下,我正在使用内置的WildFly Artemis服务器,然后配置一个JMS桥,该桥将ONCE_AND_ONLY_ONCE传递到远程ActiveMQ服务器.

In my case I am using the built-in WildFly Artemis server and then configuring a JMS bridge which does ONCE_AND_ONLY_ONCE delivery to a remote ActiveMQ server.

当然,您可以使用类似的设置,但也可以将Artemis用作远程服务器.

Of course, you could potentially use a similar setup, but with Artemis as the remote server as well.

由于我的远程服务器是ActiveMQ,所以我的RA文件与您的RA文件不同,但是配置应该相似.

Since my remote server is ActiveMQ my RA file is different to yours, but the config should be similar.

这是我的DockerFile语句,可在正确的位置复制并提取RA:

Here's my DockerFile statements that copy and extract the RA in the correct location:

COPY activemq-ra.zip /opt/platoon/wildfly/wildfly-10.1.0.Final/modules/system/layers/base/org/apache/activemq/activemq/ra/activemq-ra.zip
WORKDIR /opt/platoon/wildfly/wildfly-10.1.0.Final/modules/system/layers/base/org/apache/activemq/activemq/ra
RUN unzip activemq-ra.zip

这是我standalone-full.xml的相关部分

And here's the relevant section of my standalone-full.xml

    <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        <server name="default">
            <security-setting name="#">
                <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
            </security-setting>
            <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
            <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
            <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                <param name="batch-delay" value="50"/>
            </http-connector>
            <in-vm-connector name="in-vm" server-id="0"/>
            <http-acceptor name="http-acceptor" http-listener="default"/>
            <http-acceptor name="http-acceptor-throughput" http-listener="default">
                <param name="batch-delay" value="50"/>
                <param name="direct-deliver" value="false"/>
            </http-acceptor>
            <in-vm-acceptor name="in-vm" server-id="0"/>
            <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
            <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
            <jms-queue name="testQueue" entries="queue/test java:jboss/exported/jms/queue/test"/>
            <jms-queue name="NonBridgedTestQueue" entries="java:jboss/exported/jms/queue/nonBridgedTestQueue"/>
            <jms-queue name="BridgedTestQueue" entries="java:jboss/exported/jms/queue/bridgedTestQueue"/>
            <jms-queue name="c3mMasterQueue" entries="java:jboss/exported/jms/queue/c3mMasterQueue"/>
            <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
            <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
            <connection-factory name="InVmXAConnectionFactory" entries="java:/XAConnectionFactory" connectors="in-vm" factory-type="XA_GENERIC"/>
            <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
        </server>
        <jms-bridge name="simple-jms-bridge" quality-of-service="ONCE_AND_ONLY_ONCE" failure-retry-interval="10000" max-retries="5" max-batch-size="10" max-batch-time="100" add-messageID-in-header="true">
            <source connection-factory="java:/XAConnectionFactory" destination="jboss/exported/jms/queue/c3mMasterQueue"/>
            <target connection-factory="jboss/activemq/activeMQXAConnectionFactory" destination="jboss/activemq/queue/c3mMasterQueue"/>
        </jms-bridge>
    </subsystem>

    <subsystem xmlns="urn:jboss:domain:resource-adapters:4.0">
        <resource-adapters>
            <resource-adapter id="activemq">
        <module slot="main" id="org.apache.activemq.activemq.ra" />
                <transaction-support>XATransaction</transaction-support>
                <config-property name="ServerUrl">
                    tcp://c3m-activemq:61616?jms.rmIdFromConnectionId=true
                </config-property>
                <config-property name="UserName">
                    admin
                </config-property>
                <config-property name="UseInboundSession">
                    false
                </config-property>
                <config-property name="Password">
                    admin
                </config-property>
                <connection-definitions>
                    <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/AMQConnectionFactory" enabled="true" pool-name="AMQConnectionFactory">
                        <xa-pool>
                            <min-pool-size>1</min-pool-size>
                            <max-pool-size>20</max-pool-size>
                            <prefill>false</prefill>
                            <is-same-rm-override>false</is-same-rm-override>
                        </xa-pool>
                    </connection-definition>
                </connection-definitions>
                <admin-objects>
                    <admin-object class-name="org.apache.activemq.ActiveMQXAConnectionFactory" jndi-name="java:jboss/activemq/activeMQXAConnectionFactory" use-java-context="true" pool-name="activeMQXAConnectionFactory">
                        <config-property name="brokerURL">
                            tcp://c3m-activemq:61616?jms.rmIdFromConnectionId=true
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQTopic" jndi-name="java:jboss/activemq/topic/TestTopic" use-java-context="true" pool-name="TestTopic">
                        <config-property name="PhysicalName">
                            activemq/topic/TestTopic
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/c3mMasterQueue" use-java-context="true" pool-name="c3mMasterQueue">
                        <config-property name="PhysicalName">
                            activemq/queue/c3mMasterQueue
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/bridgedTestQueue" use-java-context="true" pool-name="BridgedTestQueue">
                        <config-property name="PhysicalName">
                            activemq/queue/bridgedTestQueue
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/TestQueue" use-java-context="true" pool-name="TestQueue">
                        <config-property name="PhysicalName">
                            activemq/queue/TestQueue
                        </config-property>
                    </admin-object>
                </admin-objects>
            </resource-adapter>
        </resource-adapters>
    </subsystem>

请注意:我只编辑了messages-activemq和resource-adapters子系统,也就是说,我没有像您所处的情况一样碰触standalone-full.xml中的其他任何部分(命名和套接字绑定).

TAKE NOTE: I only edited the messaging-activemq and resource-adapters subsystems, i.e. I didn't touch any of the other sections (naming and socket-bindings) in standalone-full.xml like in your situation.

希望有帮助

格雷格

这篇关于在启动wildfly 10.1与artemis一起使用时,未安装jboss.ra.activemq-ra错误仍然存​​在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆