You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by James Gilbertson <ja...@bitsinglass.com> on 2013/02/22 17:40:34 UTC

JBoss AS 7 w/ qpid RA and RabbitMQ: NullPointerException when receiving a message

Hi,

We're currently developing an app that needs to subscribe to a RabbitMQ queue, running on JBoss AS 7. I've tried using the quid RA, and have managed to get to the point where it's connecting to the queue. However, when a message is received, I receive the following exception:

09:18:44,446 ERROR [org.apache.qpid.client.BasicMessageConsumer] (Dispatcher-1-Conn-1) Caught exception (dump follows) - ignoring...: java.lang.NullPointerException
	at org.apache.qpid.client.message.AbstractAMQMessageDelegate.generateDestination(AbstractAMQMessageDelegate.java:117)
	at org.apache.qpid.client.message.AMQMessageDelegate_0_8.<init>(AMQMessageDelegate_0_8.java:127)
	at org.apache.qpid.client.message.AbstractJMSMessageFactory.create08MessageWithBody(AbstractJMSMessageFactory.java:103)
	at org.apache.qpid.client.message.AbstractJMSMessageFactory.createMessage(AbstractJMSMessageFactory.java:160)
	at org.apache.qpid.client.message.MessageFactoryRegistry.createMessage(MessageFactoryRegistry.java:127)
	at org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:118)
	at org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:44)
	at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:712)
	at org.apache.qpid.client.AMQSession$Dispatcher.notifyConsumer(AMQSession.java:3362)
	at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3301)
	at org.apache.qpid.client.AMQSession$Dispatcher.access$900(AMQSession.java:3088)
	at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:3081)
	at org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:54)
	at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3224)
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

Here's the configuration I'm currently using:
        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
            <resource-adapters>
                <resource-adapter>
                    <archive>
                        qpid-ra-0.20.rar
                    </archive>
                    <transaction-support>XATransaction</transaction-support>
                    <config-property name="TransactionManagerLocatorClass">
                        org.apache.qpid.ra.tm.JBoss7TransactionManagerLocator
                    </config-property>
                    <config-property name="connectionURL">
                        amqp://guest:guest@/?brokerlist='tcp://localhost:5672'
                    </config-property>
                    <config-property name="TransactionManagerLocatorMethod">
                        getTm
                    </config-property>
                    <admin-objects>
                        <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="java:/amqp/queue/ldav" use-java-context="false" pool-name="LdavAmqp">
                            <config-property name="DestinationAddress">
                                BURL:direct://excAlarms//sps.queue?durable='true'
                            </config-property>
                        </admin-object>
                    </admin-objects>
                </resource-adapter>
            </resource-adapters>
        </subsystem>

Is there something wrong with the above configuration? Or is it a bug with looking up the exchange? Because when I patch generateDestination to use the default exchange name of "" when exchange is null, receiving messages work fine.

--
James Gilbertson
Software Architect/Developer
Bits In Glass Inc.

http://www.bitsinglass.com
james.gilbertson@bitsinglass.com
+1 780-436-4484 ext. 8002


Re: JBoss AS 7 w/ qpid RA and RabbitMQ: NullPointerException when receiving a message

Posted by Rob Godfrey <ro...@gmail.com>.
Hi Pavel,

if attempting to connect to RabbitMQ (as per his original message)
then James will not be able to use the 0.10 protocol as RabbitMQ only
supports versions <= 0.9.1.  The use of this older version of the
protocol forces the use of Binding URL (BURL) address strings, as no
implementation of the newer ADDR scheme was ever made for the
0-9/9/9-1 protocol dtack in the Java client.

In general I'm not sure if anyone has ever tested the resource adapter
with RabbitMQ... Last I looked Rabbit didn't support the extensions
necessary to provide fully JMS capability (e.g. selectors, queue
browsing) and there is no way to access distributed transaction
functionality through the AMQP 0.8/9/9.1 protocols.

-- Rob

On 26 February 2013 14:03, Pavel Moravec <pm...@redhat.com> wrote:
> Hi James,
> this comes from UnprocessedMessage_0_8 where _exchange seems not to be initialized - no idea why.
>
> Anyway is there some reason to use AMQP 0.8 or BURL syntax (deprecated in favour of address strings)? It is probable the apparently bug is not present when using either address strings or higher AMQP protocol version (currently in qpid client, 0.10).
>
> Kind regards,
> Pavel Moravec
>
>
> ----- Original Message -----
>> From: "James Gilbertson" <ja...@bitsinglass.com>
>> To: users@qpid.apache.org
>> Sent: Friday, February 22, 2013 5:40:34 PM
>> Subject: JBoss AS 7 w/ qpid RA and RabbitMQ: NullPointerException when receiving a message
>>
>> Hi,
>>
>> We're currently developing an app that needs to subscribe to a
>> RabbitMQ queue, running on JBoss AS 7. I've tried using the quid RA,
>> and have managed to get to the point where it's connecting to the
>> queue. However, when a message is received, I receive the following
>> exception:
>>
>> 09:18:44,446 ERROR [org.apache.qpid.client.BasicMessageConsumer]
>> (Dispatcher-1-Conn-1) Caught exception (dump follows) - ignoring...:
>> java.lang.NullPointerException
>>       at
>>       org.apache.qpid.client.message.AbstractAMQMessageDelegate.generateDestination(AbstractAMQMessageDelegate.java:117)
>>       at
>>       org.apache.qpid.client.message.AMQMessageDelegate_0_8.<init>(AMQMessageDelegate_0_8.java:127)
>>       at
>>       org.apache.qpid.client.message.AbstractJMSMessageFactory.create08MessageWithBody(AbstractJMSMessageFactory.java:103)
>>       at
>>       org.apache.qpid.client.message.AbstractJMSMessageFactory.createMessage(AbstractJMSMessageFactory.java:160)
>>       at
>>       org.apache.qpid.client.message.MessageFactoryRegistry.createMessage(MessageFactoryRegistry.java:127)
>>       at
>>       org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:118)
>>       at
>>       org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:44)
>>       at
>>       org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:712)
>>       at
>>       org.apache.qpid.client.AMQSession$Dispatcher.notifyConsumer(AMQSession.java:3362)
>>       at
>>       org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3301)
>>       at
>>       org.apache.qpid.client.AMQSession$Dispatcher.access$900(AMQSession.java:3088)
>>       at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:3081)
>>       at
>>       org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:54)
>>       at
>>       org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3224)
>>       at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
>>
>> Here's the configuration I'm currently using:
>>         <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
>>             <resource-adapters>
>>                 <resource-adapter>
>>                     <archive>
>>                         qpid-ra-0.20.rar
>>                     </archive>
>>                     <transaction-support>XATransaction</transaction-support>
>>                     <config-property
>>                     name="TransactionManagerLocatorClass">
>>                         org.apache.qpid.ra.tm.JBoss7TransactionManagerLocator
>>                     </config-property>
>>                     <config-property name="connectionURL">
>>                         amqp://guest:guest@/?brokerlist='tcp://localhost:5672'
>>                     </config-property>
>>                     <config-property
>>                     name="TransactionManagerLocatorMethod">
>>                         getTm
>>                     </config-property>
>>                     <admin-objects>
>>                         <admin-object
>>                         class-name="org.apache.qpid.ra.admin.QpidQueueImpl"
>>                         jndi-name="java:/amqp/queue/ldav"
>>                         use-java-context="false"
>>                         pool-name="LdavAmqp">
>>                             <config-property
>>                             name="DestinationAddress">
>>                                 BURL:direct://excAlarms//sps.queue?durable='true'
>>                             </config-property>
>>                         </admin-object>
>>                     </admin-objects>
>>                 </resource-adapter>
>>             </resource-adapters>
>>         </subsystem>
>>
>> Is there something wrong with the above configuration? Or is it a bug
>> with looking up the exchange? Because when I patch
>> generateDestination to use the default exchange name of "" when
>> exchange is null, receiving messages work fine.
>>
>> --
>> James Gilbertson
>> Software Architect/Developer
>> Bits In Glass Inc.
>>
>> http://www.bitsinglass.com
>> james.gilbertson@bitsinglass.com
>> +1 780-436-4484 ext. 8002
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: JBoss AS 7 w/ qpid RA and RabbitMQ: NullPointerException when receiving a message

Posted by Pavel Moravec <pm...@redhat.com>.
Hi James,
this comes from UnprocessedMessage_0_8 where _exchange seems not to be initialized - no idea why.

Anyway is there some reason to use AMQP 0.8 or BURL syntax (deprecated in favour of address strings)? It is probable the apparently bug is not present when using either address strings or higher AMQP protocol version (currently in qpid client, 0.10).

Kind regards,
Pavel Moravec


----- Original Message -----
> From: "James Gilbertson" <ja...@bitsinglass.com>
> To: users@qpid.apache.org
> Sent: Friday, February 22, 2013 5:40:34 PM
> Subject: JBoss AS 7 w/ qpid RA and RabbitMQ: NullPointerException when receiving a message
> 
> Hi,
> 
> We're currently developing an app that needs to subscribe to a
> RabbitMQ queue, running on JBoss AS 7. I've tried using the quid RA,
> and have managed to get to the point where it's connecting to the
> queue. However, when a message is received, I receive the following
> exception:
> 
> 09:18:44,446 ERROR [org.apache.qpid.client.BasicMessageConsumer]
> (Dispatcher-1-Conn-1) Caught exception (dump follows) - ignoring...:
> java.lang.NullPointerException
> 	at
> 	org.apache.qpid.client.message.AbstractAMQMessageDelegate.generateDestination(AbstractAMQMessageDelegate.java:117)
> 	at
> 	org.apache.qpid.client.message.AMQMessageDelegate_0_8.<init>(AMQMessageDelegate_0_8.java:127)
> 	at
> 	org.apache.qpid.client.message.AbstractJMSMessageFactory.create08MessageWithBody(AbstractJMSMessageFactory.java:103)
> 	at
> 	org.apache.qpid.client.message.AbstractJMSMessageFactory.createMessage(AbstractJMSMessageFactory.java:160)
> 	at
> 	org.apache.qpid.client.message.MessageFactoryRegistry.createMessage(MessageFactoryRegistry.java:127)
> 	at
> 	org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:118)
> 	at
> 	org.apache.qpid.client.BasicMessageConsumer_0_8.createJMSMessageFromUnprocessedMessage(BasicMessageConsumer_0_8.java:44)
> 	at
> 	org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:712)
> 	at
> 	org.apache.qpid.client.AMQSession$Dispatcher.notifyConsumer(AMQSession.java:3362)
> 	at
> 	org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3301)
> 	at
> 	org.apache.qpid.client.AMQSession$Dispatcher.access$900(AMQSession.java:3088)
> 	at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:3081)
> 	at
> 	org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:54)
> 	at
> 	org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3224)
> 	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
> 
> Here's the configuration I'm currently using:
>         <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
>             <resource-adapters>
>                 <resource-adapter>
>                     <archive>
>                         qpid-ra-0.20.rar
>                     </archive>
>                     <transaction-support>XATransaction</transaction-support>
>                     <config-property
>                     name="TransactionManagerLocatorClass">
>                         org.apache.qpid.ra.tm.JBoss7TransactionManagerLocator
>                     </config-property>
>                     <config-property name="connectionURL">
>                         amqp://guest:guest@/?brokerlist='tcp://localhost:5672'
>                     </config-property>
>                     <config-property
>                     name="TransactionManagerLocatorMethod">
>                         getTm
>                     </config-property>
>                     <admin-objects>
>                         <admin-object
>                         class-name="org.apache.qpid.ra.admin.QpidQueueImpl"
>                         jndi-name="java:/amqp/queue/ldav"
>                         use-java-context="false"
>                         pool-name="LdavAmqp">
>                             <config-property
>                             name="DestinationAddress">
>                                 BURL:direct://excAlarms//sps.queue?durable='true'
>                             </config-property>
>                         </admin-object>
>                     </admin-objects>
>                 </resource-adapter>
>             </resource-adapters>
>         </subsystem>
> 
> Is there something wrong with the above configuration? Or is it a bug
> with looking up the exchange? Because when I patch
> generateDestination to use the default exchange name of "" when
> exchange is null, receiving messages work fine.
> 
> --
> James Gilbertson
> Software Architect/Developer
> Bits In Glass Inc.
> 
> http://www.bitsinglass.com
> james.gilbertson@bitsinglass.com
> +1 780-436-4484 ext. 8002
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org