Java 无法识别传输方案:[tcp]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22987656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 19:47:40  来源:igfitidea点击:

Transport scheme NOT recognized: [tcp]

javaspringactivemq

提问by Thom

It has been years since I worked with activeMQ some. I am now implementing a new activeMQ server with client apps on the inside and outside.

自从我与 activeMQ 合作以来已经有很多年了。我现在正在实施一个新的 activeMQ 服务器,内部和外部都有客户端应用程序。

I tested my outside client app locally, but when I deployed it, I started getting errors like:

我在本地测试了我的外部客户端应用程序,但是当我部署它时,我开始收到如下错误:

2014-04-10 08:01:31,392 [signInResultListenerContainer-1] ERROR org.springframework.jms.listener.DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'queue://signInResult' - retrying in 5000 ms. Cause: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [tcp]

I checked the firewall on my server and it is wide open.

我检查了服务器上的防火墙,它是敞开的。

<bean id="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://xxx.30.8.163:61616"/>
</bean>

Any ideas on what is causing the error?

关于导致错误的原因的任何想法?

采纳答案by Andrei Stefan

I believe you don't have the necessary resources in your classpath. Take a look at this similar issueand check the ActiveMQ jars/resources from the classpath.

我相信您的类路径中没有必要的资源。看看这个类似的问题并检查类路径中的 ActiveMQ jars/资源。

回答by Obakeng Balatseng

The easiest way to resolve is to prefill the ConnectionFactory with connections by setting the prefill element to true in the ra config

最简单的解决方法是通过在 ra 配置中将 prefill 元素设置为 true 来用连接预填充 ConnectionFactory

        <connection-definitions>
            <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/ConnectionFactory" enabled="true" pool-name="ConnectionFactory">
                <xa-pool>
                    <min-pool-size>1</min-pool-size>
                    <max-pool-size>20</max-pool-size>
                    <prefill>true</prefill>
                    <is-same-rm-override>false</is-same-rm-override>
                </xa-pool>
            </connection-definition>
        </connection-definitions>

回答by Elhanan Mishraky

I'm using Spring Boot, and this is what solved it for me:

我正在使用 Spring Boot,这就是为我解决的问题:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-activemq</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-activemq</artifactId>
    </dependency>