qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ritchie <ritch...@apache.org>
Subject Re: Issue connecting to Qpid Broker
Date Fri, 16 Oct 2009 14:21:29 GMT
Hi Yogesh,

Would be good to see your full code, log4j settings and classpath

There may be some interaction between the Qpid Client logging and the
Log4j initialisation.

I don't think you can send a tar of your code to the list but if you
send it to me directly then I'll try and reproduce the issue.

Cheers
Martin
2009/10/16 Yogesh Rao <yogu13@gmail.com>:
> Hi,
>
> Below is the log of qpid broker (This is not the complete log) ...
>
> 2009-10-15 15:18:30,122 DEBUG [pool-1-thread-4] framing.FieldTable
> (FieldTable.java:1063) - FieldTable::FieldTable(buffer,187): Done.
> 2009-10-15 15:18:30,122 DEBUG [pool-1-thread-4]
> protocol.AMQMinaProtocolSession (AMQMinaProtocolSession.java:213) - Frame
> Received: Frame channelId: 0, bodyFrame: [ConnectionStartOkBodyImpl:
> clientProperties={instance=[LONG_STRING: localhost], product=[LONG_STRING:
> Qpid Client], version=[LONG_STRING: 2.2.2.0], platform=[LONG_STRING:
> Java(TM) SE Runtime Environment, 1.6.0_13-b03, Sun Microsystems Inc., x86,
> Windows XP, 5.1, Service Pack 2]}, mechanism=CRAM-MD5, response=null,
> locale=en_US]
> 2009-10-15 15:18:30,309 INFO  [pool-1-thread-4]
> handler.ConnectionStartOkMethodHandler
> (ConnectionStartOkMethodHandler.java:65) - SASL Mechanism selected: CRAM-MD5
> 2009-10-15 15:18:30,309 INFO  [pool-1-thread-4]
> handler.ConnectionStartOkMethodHandler
> (ConnectionStartOkMethodHandler.java:66) - Locale selected: en_US
> 2009-10-15 15:18:30,309 DEBUG [pool-1-thread-4] state.AMQStateManager
> (AMQStateManager.java:166) - State changing to CONNECTION_NOT_AUTH from old
> state CONNECTION_NOT_AUTH
> 2009-10-15 15:18:30,309 DEBUG [pool-1-thread-1] framing.AMQDataBlockEncoder
> (AMQDataBlockEncoder.java:51) - Encoded frame byte-buffer is
> '0x01000000000035000a00140000002d3c383433373535363236373934343337333730302e31323535363030313130333039406c6f63616c686f73743ece'
> 2009-10-15 15:18:30,309 DEBUG [SocketAcceptorIoProcessor-0.3]
> protocol.AMQPFastProtocolHandler (AMQPFastProtocolHandler.java:270) -
> Message sent: HeapBuffer[pos=0 lim=61 cap=61: 01 00 00 00 00 00 35 00 0A 00
> 14 00 00 00 2D 3C 38 34 33 37 35 35 36 32 36 37 39 34 34 33 37 33 37 30 30
> 2E 31 32 35 35 36 30 30 31 31 30 33 30 39 40 6C 6F 63 61 6C 68 6F 73 74 3E
> CE]
> 2009-10-15 15:18:30,309 DEBUG [SocketAcceptorIoProcessor-0.3]
> protocol.AMQPFastProtocolHandler (AMQPFastProtocolHandler.java:270) -
> Message sent: Frame channelId: 0, bodyFrame: [ConnectionSecureBodyImpl:
> challenge=[B@132021a]
> 2009-10-15 15:18:30,325 DEBUG [pool-1-thread-2]
> protocol.AMQMinaProtocolSession (AMQMinaProtocolSession.java:213) - Frame
> Received: Frame channelId: 0, bodyFrame: [ConnectionSecureOkBodyImpl:
> response=[B@2803d5]
> 2009-10-15 15:18:30,325 INFO  [pool-1-thread-2]
> handler.ConnectionSecureOkMethodHandler
> (ConnectionSecureOkMethodHandler.java:74) - Authentication failed:Invalid
> response
> 2009-10-15 15:18:30,325 DEBUG [pool-1-thread-2] state.AMQStateManager
> (AMQStateManager.java:166) - State changing to CONNECTION_CLOSING from old
> state CONNECTION_NOT_AUTH
>
> my jndi.properties looks like
>
> java.naming.factory.initial =
> org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> # connectionfactory.[jndiname] = [ConnectionURL]
> connectionfactory.asychLoggingConnectionFactory =
> amqp://guest:guest@localhost/test?brokerlist='tcp://localhost:5672'
> # topic.[jndiName] = [physicalName]
> topic.test = test
>
>
> Do let me know incase you need anything else ...
>
> Note:- The issue only comes when i am trying to connect from within log4j. A
> standalone code works just fine ...
>
> Thank you!
>
> Regards,
> -Yogesh
>
> On Thu, Oct 15, 2009 at 1:49 AM, Marnie McCormack <
> marnie.mccormack@googlemail.com> wrote:
>
>> Can you cat the content of your jndi properties file ? Swtiching log level
>> to debug for the broker would show a connection attempt, but I suspect your
>> jndi might be the issue.
>>
>> Thanks,
>> Marnie
>>
>> On Tue, Oct 13, 2009 at 6:08 PM, Yogesh Rao <yogu13@gmail.com> wrote:
>>
>> > Hi Can anyone help me on this ????
>> > Any directions on this would be extremely helpful ...
>> >
>> > Thanks in advance !!
>> >
>> > On Sun, Oct 11, 2009 at 11:00 PM, Yogesh Rao <yogu13@gmail.com> wrote:
>> >
>> > > Hi,
>> > >
>> > > I am facing an unusual problem when i try to connect to qpid from
>> within
>> > > Log4j. Let me give a overview of what i am trying to do here ... I am
>> > > creating my own JMS appender implementation (for some specific reason)
>> > and
>> > > trying to send the logging message over JMS. This is based on publish
>> > > subscribe. I have written sample pub / sub code and it works very well
>> > with
>> > > qpid. I am trying to move that into JMSAppender and it seems to be
>> > throwing
>> > > a timeout exception when it tries to createTopicConnection ...
>> > >
>> > > Below is the code which i have written ...
>> > >
>> > > public class JMSAppender extends AppenderSkeleton {
>> > >
>> > >        public void activateOptions() {
>> > >
>> > > try {
>> > >
>> > > Properties env = new Properties( );
>> > > env.load(new FileInputStream("d:/qpid-config.properties"));
>> > > Context jndi = new InitialContext(env);
>> > > TopicConnectionFactory topicConnectionFactory =
>> (TopicConnectionFactory)
>> > > lookup(jndi, "qpidConnectionFactory");
>> > > Topic topic = (Topic) lookup(jndi, "logTopic");
>> > > if (userName != null) {
>> > >
>> > > topicConnection =
>> topicConnectionFactory.createTopicConnection(userName,
>> > > password);
>> > >
>> > > } else {
>> > >          * // here is the problem *
>> > >           *topicConnection =
>> > > topicConnectionFactory.createTopicConnection();*
>> > > }
>> > > topicSession =
>> > > topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
>> > > topicPublisher = topicSession.createPublisher(topic);
>> > > topicConnection.start();
>> > > jndi.close();
>> > >
>> > > } catch (Exception e) {
>> > >
>> > > e.printStackTrace();
>> > >
>> > > }
>> > >
>> > >
>> > > }
>> > >
>> > >
>> > > Below is the exception trace that i get ....
>> > >
>> > > javax.jms.JMSException: Error creating connection: Timeout waiting for
>> > > connection.
>> > >  at
>> > >
>> >
>> org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:325)
>> > > at
>> > >
>> >
>> org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:296)
>> > >  at
>> > >
>> >
>> org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(AMQConnectionFactory.java:348)
>> > > at sample.logging.JMSAppender.activateOptions(JMSAppender.java:62)
>> > >  at
>> > >
>> org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
>> > > at
>> > >
>> >
>> org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:285)
>> > >  at
>> > >
>> >
>> org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
>> > > at
>> > >
>> >
>> org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
>> > >
>> > > Do let me know how can i fix the issue... looking at the code i don't
>> see
>> > > any problem, strangely this only happens when log4j is trying to
>> connect
>> > to
>> > > qpid using the appender... could that be a problem ? Please advice...
>> > >
>> > > Thank you in advance ...
>> > >
>> > >
>> > >
>> >
>>
>



-- 
Martin Ritchie

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message