[
https://issues.apache.org/jira/browse/QPID-5526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13886978#comment-13886978
]
Robbie Gemmell commented on QPID-5526:
--------------------------------------
Hi Lukasz,
There are a number of things to cover here unfortunately...first up, although
it is failing to establish the connection for some reason, even if it had got
past that you would find that due to changes on both client and broker sides
the 0.24 client wont work against recent RabbitMQ 3.x brokers for a variety of
reasons (e.g QPID-5224 and QPID-5184, plus potentially the issue that I did
QPID-5223 to assist with). That is to say, you would need to either need to use
older versions of Qpid and RabbitMQ, or try the 0.26 RC3 binaries
(http://people.apache.org/~jross/qpid-0.26-rc3/) which includes the changes
made to resolve the issues or offer workarounds.
As to the actual connection failure, it is hard to say much from the above
except that the AMQP connection negotiation failed after the protocol header
was sent but before the client believed it to have successfully opened or it
figured out that it was closed, and so it threw an exception after timing out.
There could be a variety of reasons, but the above doesnt really give anything
to go on. Some things might be things like the 'test' virtualhost specified in
the Connection URL not existing, or you not having access to it, or...lots of
things. Can you tell from the broker logs if it blocked the connection for some
reason? Some really verbose protocol debug logging from the client might be
useful; try setting the system property amqj.protocol.logging.level to
anything, and the qpid.protocol logger (or all of them) to debug level.
I'd also note that the Hello example wont work as-shipped against an AMQP 0-9-1
broker due to the destination syntax the client defaults to using, but I think
you might already know that based on the fact it loks like you requested the
client to have started the negotiation at AMQP 0-9-1 rather than its normal
0-10, and the logging indicates your modified hello2.properties JNDI file had
'queue.<lookup> = name' format strings which should work.
Robbie
> Cannot connect to RabbitMQ Broker
> ---------------------------------
>
> Key: QPID-5526
> URL: https://issues.apache.org/jira/browse/QPID-5526
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Affects Versions: 0.24
> Environment: Windows, Eclipse Juno
> Reporter: Lukasz Miroslaw
> Labels: test
>
> I am not able to establish the connection to RabbitMQ from Hello.java example:
> Hashtable env = new Hashtable();
> URL url = getClass().getResource( "hello2.properties" );
> env.put("java.naming.provider.url", url.getPath());
> env.put("java.naming.factory.initial",
> "org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
> Context context = new InitialContext(env);
> ConnectionFactory connectionFactory = (ConnectionFactory)
> context.lookup("localhost");
> Connection connection = connectionFactory.createConnection();
> hello.properties:
> java.naming.factory.initial =
> org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> connectionfactory.localhost=amqp://guest:guest@clientid/test?brokerlist='tcp://172.16.36.31:5672'
> queue.queue = queue
> This is my stacktrace. Maybe you see something I cannot see?
> #logback.classic pattern: %-50(%d{dd.MM.yyyy HH:mm:ss.SSS} [%file])
> [%-5level] [%-10thread] %msg%n
> 14:11:47,558 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could
> NOT find resource [logback.groovy]
> 14:11:47,558 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could
> NOT find resource [logback-test.xml]
> 14:11:47,558 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found
> resource [logback.xml] at
> [file:/D:/workspace/prem/prem-huntgroup/target/classes/logback.xml]
> 14:11:47,559 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
> Resource [logback.xml] occurs multiple times on the classpath.
> 14:11:47,559 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
> Resource [logback.xml] occurs at
> [file:/D:/workspace/prem/prem-commons/commons/target/classes/logback.xml]
> 14:11:47,559 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
> Resource [logback.xml] occurs at
> [file:/D:/workspace/prem/prem-huntgroup/target/classes/logback.xml]
> 14:11:47,621 |-INFO in
> ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not
> set
> 14:11:47,627 |-INFO in
> ch.qos.logback.classic.joran.action.ConfigurationAction - Setting
> ReconfigureOnChangeFilter scanning period to 30 seconds
> 14:11:47,627 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will
> scan for changes in
> [[D:\workspace\prem\prem-huntgroup\target\classes\logback.xml]] every 30
> seconds.
> 14:11:47,627 |-INFO in
> ch.qos.logback.classic.joran.action.ConfigurationAction - Adding
> ReconfigureOnChangeFilter as a turbo filter
> 14:11:47,630 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
> About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
> 14:11:47,633 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
> Naming appender as [CONSOLE]
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [org.springframework] to DEBUG
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [com.ucware.ucpo.forward] to DEBUG
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [org.myvoipsource.cisco.axl.base.ssl] to INFO
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [com.cisco] to INFO
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [org.apache.axis] to INFO
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [org.apache.commons] to INFO
> 14:11:47,699 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction -
> Setting level of ROOT logger to TRACE
> 14:11:47,699 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction -
> Attaching appender named [CONSOLE] to Logger[ROOT]
> 14:11:47,700 |-INFO in
> ch.qos.logback.classic.joran.action.ConfigurationAction - End of
> configuration.
> 14:11:47,700 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@156d3a9
> - Registering current configuration as safe fallback point
> 30.01.2014 14:11:47.705 [PropertiesFileInitialContextFactory.java] [INFO ]
> [main ] Attempting to load
> /D:/workspace/prem/prem-huntgroup/target/test-classes/com/ucware/ucpo/huntgroup/qpid/hello2.properties
> 30.01.2014 14:11:47.710 [PropertiesFileInitialContextFactory.java] [INFO ]
> [main ] Loaded Context
> Properties:{java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory,
>
> java.naming.provider.url=/D:/workspace/prem/prem-huntgroup/target/test-classes/com/ucware/ucpo/huntgroup/qpid/hello2.properties,
> queue.queue=queue,
> connectionfactory.localhost=amqp://guest:guest@clientid/test?brokerlist='tcp://172.16.36.31:5672'}
> 30.01.2014 14:11:47.726 [AMQDestination.java] [DEBUG] [main ] Based
> on direct://amq.direct/queue/queue?routingkey='queue'&durable='true' the
> selected destination syntax is BURL
> 30.01.2014 14:12:29.447 [AMQConnection.java] [DEBUG] [main ]
> Connection(1):amqp://guest:********@clientid/test?brokerlist='tcp://172.16.36.31:5672'
> 30.01.2014 14:12:29.448 [AMQConnection.java] [DEBUG] [main ] AMQP
> version 0-91
> 30.01.2014 14:12:30.273 [AMQProtocolSession.java] [DEBUG] [main ] Using
> ProtocolVersion for Session:0-91
> 30.01.2014 14:12:30.328 [ClientMethodDispatcherImpl.java] [DEBUG] [main
> ] New Method Dispatcher:AMQProtocolSession[null]
> 30.01.2014 14:12:30.342 [ContentHeaderBodyFactory.java] [DEBUG] [main ]
> Creating content header body factory
> 30.01.2014 14:12:30.343 [ContentBodyFactory.java] [DEBUG] [main ]
> Creating content body factory
> 30.01.2014 14:12:30.348 [AMQConnection.java] [DEBUG] [main ]
> Connecting with ProtocolHandler Version:0-91
> 30.01.2014 14:12:30.348 [AMQConnectionDelegate_8_0.java] [DEBUG] [main ]
> Connecting to broker:tcp://172.16.36.31:5672
> 30.01.2014 14:12:30.373 [IoNetworkTransport.java] [DEBUG] [main ]
> SO_RCVBUF : 65535
> 30.01.2014 14:12:30.373 [IoNetworkTransport.java] [DEBUG] [main ]
> SO_SNDBUF : 65535
> 30.01.2014 14:12:30.374 [IoNetworkTransport.java] [DEBUG] [main ]
> TCP_NODELAY : true
> 30.01.2014 14:12:30.394 [StateWaiter.java] [DEBUG] [main ] New
> StateWaiter :AMQState: id = 1 name: CONNECTION_NOT_STARTED:[AMQState: id = 4
> name: CONNECTION_OPEN, AMQState: id = 6 name: CONNECTION_CLOSED]
> 30.01.2014 14:12:30.404 [AMQProtocolHandler.java] [DEBUG] [main ] Sent
> 1 protocol messages
> 30.01.2014 14:13:00.423 [AMQConnection.java] [INFO ] [main ]
> Unable to connect to broker at tcp://172.16.36.31:5672
> org.apache.qpid.AMQTimeoutException: Server did not respond in a timely
> fashion
> at
> org.apache.qpid.client.util.BlockingWaiter.block(BlockingWaiter.java:177)
> ~[qpid-client-0.24.jar:na]
> at org.apache.qpid.client.state.StateWaiter.await(StateWaiter.java:114)
> ~[qpid-client-0.24.jar:na]
> at org.apache.qpid.client.state.StateWaiter.await(StateWaiter.java:91)
> ~[qpid-client-0.24.jar:na]
> at
> org.apache.qpid.client.AMQConnectionDelegate_8_0.makeBrokerConnection(AMQConnectionDelegate_8_0.java:135)
> ~[qpid-client-0.24.jar:na]
> at
> org.apache.qpid.client.AMQConnection.makeBrokerConnection(AMQConnection.java:619)
> ~[qpid-client-0.24.jar:na]
> at org.apache.qpid.client.AMQConnection.<init>(AMQConnection.java:398)
> ~[qpid-client-0.24.jar:na]
> at
> org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:121)
> [qpid-client-0.24.jar:na]
> at
> com.ucware.ucpo.huntgroup.qpid.HelloFromJMSClient.ConnectionTest(HelloFromJMSClient.java:63)
> [test-classes/:na]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.7.0_13]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> ~[na:1.7.0_13]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_13]
> at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_13]
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> [junit-4.11.jar:na]
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> [junit-4.11.jar:na]
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> [junit-4.11.jar:na]
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> [junit-4.11.jar:na]
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> [junit-4.11.jar:na]
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> [junit-4.11.jar:na]
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> [.cp/:na]
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]