简体   繁体   English

与JMS代理的连接失败

[英]Connection to JMS broker failing

I have a Glassfish server (4.1.2) and following this tutorial I have integrated Apache ActiveMQ to the server. 我有一个Glassfish服务器(4.1.2),并按照本教程将Apache ActiveMQ集成到服务器中。 Afterwards I developed a standalone Client for messaging according to this part of the same tutorial . 之后,根据同一教程的这一部分,我开发了一个用于消息传递的独立客户端。 Finished with that I followed the last part of this tutorial to develop a MessageDrivenBean listening to the queue used in the steps before. 最后 ,我按照本教程最后一部分开发了一个MessageDrivenBean,以侦听前面步骤中使用的队列。

Everything compiled fine. 一切都编译良好。 ActiveMQ is also running. ActiveMQ也正在运行。 But whenever I deploy the EJB the following is logged in my GF server log: 但是,无论何时部署EJB,GF服务器日志中都会记录以下内容:

Info:   visiting unvisited references
Info:   visiting unvisited references
Info:   JTS5014: Recoverable JTS instance, serverId = [3700]
Warning:   RAR8000 : The method setDestinationLookup is not present in the class : org.apache.activemq.ra.ActiveMQActivationSpec
Warning:   RAR7097: No setter method present for the property destinationLookup in the class org.apache.activemq.ra.ActiveMQActivationSpec
Info:   2017-06-06 11:43:00,675 [min-listener(1)] INFO  ActiveMQEndpointWorker         - Starting
Info:   2017-06-06 11:43:00,682 [ad-pool-1; w: 4] INFO  ActiveMQEndpointWorker         - Establishing connection to broker [vm://0.0.0.0:6616]
Info:   WELD-000900: 2.2.13 (Final)
WARN:   WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
WARN:   WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Info:   AmdMDB was successfully deployed in 5.290 milliseconds.
Info:   2017-06-06 11:43:31,695 [ad-pool-1; w: 4] ERROR ActiveMQEndpointWorker         - Failed to connect to broker [vm://0.0.0.0:6616]: Could not create Transport. Reason: java.net.URISyntaxException: Illegal character in scheme name at index 0: 0.0.0.0:6616
javax.jms.JMSException: Could not create Transport. Reason: java.net.URISyntaxException: Illegal character in scheme name at index 0: 0.0.0.0:6616
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
    at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:260)
    at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:273)
    at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:194)
    at org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:132)
    at org.apache.activemq.ra.ActiveMQEndpointWorker$1.run(ActiveMQEndpointWorker.java:109)
    at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:107)
    at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
    at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: 0.0.0.0:6616
    at java.net.URI$Parser.fail(URI.java:2848)
    at java.net.URI$Parser.checkChars(URI.java:3021)
    at java.net.URI$Parser.checkChar(URI.java:3031)
    at java.net.URI$Parser.parse(URI.java:3047)
    at java.net.URI.<init>(URI.java:588)
    at org.apache.activemq.util.URISupport.parseComposite(URISupport.java:390)
    at org.apache.activemq.util.URISupport.parseComposite(URISupport.java:279)
    at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:63)
    at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:54)
    at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:64)
    at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:258)
    ... 7 more
Info:   2017-06-06 11:43:31,697 [ad-pool-1; w: 4] ERROR ActiveMQEndpointWorker         - Endpoint will try to reconnect to the JMS broker in 30 seconds
Info:   2017-06-06 11:43:40,060 [jb-thread-pool1] INFO  ActiveMQEndpointWorker         - Stopping

The Stopping at the end is due to the undeployment I did, because the same error would come every thirty seconds with the reconnection try. 最后停止是由于我所做的取消部署,因为重新连接尝试每30秒就会出现相同的错误。

I am not quite sure, where the error is. 我不太确定错误在哪里。 The port is 6616 by the way isn't a typo, it is the actual port where ActiveMQ is running because port 61616 is in use by another process. 顺便说一句,该端口为6616并不是一个错字,它是ActiveMQ运行的实际端口,因为另一个进程正在使用该端口61616。

Can you please give me a hint, on where to search for the mistake? 您能给我一个提示,关于在哪里查找错误吗?

By the way: When I send a message to the queue with the standalone client, no Exception is thrown (so this seems to be working.) However, I am also unable to send a message via the ActiveMQ Admin console to the server. 顺便说一句:当我使用独立客户端将消息发送到队列时,不会引发任何异常(因此这似乎可以正常工作。)但是,我也无法通过ActiveMQ管理控制台向服务器发送消息。

Thanks a lot... 非常感谢...

According to http://activemq.apache.org/vm-transport-reference.html , when using activemq vm tranport, it should be the broker name after "vm://". 根据http://activemq.apache.org/vm-transport-reference.html的说明 ,使用activemq vm tranport时,它应该是“ vm://”之后的代理名称。

If want to use the ip and port, config this way: 如果要使用ip和端口,请按以下方式配置:

vm:(broker:(tcp://localhost:6000)?persistent=false)?marshal=false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM