2017-06-06 82 views
0

我有一個Glassfish服務器(4.1.2)和以下this tutorial我已將Apache ActiveMQ集成到服務器。之後,我根據this part of the same tutorial開發了一個獨立的客戶端進行消息傳遞。完成之後我跟着last part of this tutorial開發了一個MessageDrivenBean,監聽之前步驟中使用的隊列。連接到JMS代理失敗

一切正常編譯。 ActiveMQ也在運行。但每當我部署以下是我的GF服務器日誌中記錄的EJB:

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 

末停止是由於取消部署我做到了,因爲同樣的錯誤將每三十秒配重聯試。

我不太確定,錯誤在哪裏。順便提一下,6616端口不是輸入錯誤,它是ActiveMQ運行的實際端口,因爲端口61616正在被另一個進程使用。

您能否給我一個提示,在哪裏尋找錯誤?順便說一句:當我向獨立客戶端發送消息到隊列中時,沒有引發異常(所以這似乎工作。)但是,我也無法通過ActiveMQ管理控制檯發送消息到服務器。

非常感謝......

回答

1

http://activemq.apache.org/vm-transport-reference.html,使用ActiveMQ的VM tranport時,後面應該經紀人名 「VM://」。

如果要使用的IP和端口,配置是這樣的:

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

好感謝,幫助。現在日誌說'成功建立連接到代理[vm:broker:(tcp://0.0.0.0))]''。而且我正在接收消息。你是一個生活:) –

+0

是否有一個原因,我必須等待大約1分鐘,直到我從activemq管理控制檯的服務器日誌中收到一條消息? –

+0

@FabianSchneider這似乎並不正常。但我無法弄清楚爲什麼此刻1分鐘的延遲。也許一些非常詳細的原因。 – Solo