NullPointerException in ActiveMQDestination (with patch)
--------------------------------------------------------

                 Key: AMQ-2630
                 URL: https://issues.apache.org/activemq/browse/AMQ-2630
             Project: ActiveMQ
          Issue Type: Bug
            Reporter: juergen schmied
             Fix For: 5.4.0
         Attachments: Destination.patch

The Oracle AQjmsDestination Object implements all the interfaces:

AQjmsDestination
 <-Queue<-Destination
 <-TemporaryQueue<-Queue<-Destination
 <-TemporaryTopicTopic<-Destination
 <-Topic<-Destination

The function ActiveMQDestination.transform fails to indicate the type of the 
Destination Object right, because it implements all Interfaces.

When the Object its a Topic in reality, the

        if (dest instanceof TemporaryQueue) {
            return new ActiveMQTempQueue(((TemporaryQueue)dest).getQueueName());
        }

thinks its a TemporaryQueue.

This causes the following stacktrace:
java.lang.NullPointerException
        at 
org.apache.activemq.command.ActiveMQDestination.setPhysicalName(ActiveMQDestination.java:208)
        at 
org.apache.activemq.command.ActiveMQTempDestination.setPhysicalName(ActiveMQTempDestination.java:63)
        at 
org.apache.activemq.command.ActiveMQDestination.<init>(ActiveMQDestination.java:77)
        at 
org.apache.activemq.command.ActiveMQTempDestination.<init>(ActiveMQTempDestination.java:39)
        at 
org.apache.activemq.command.ActiveMQTempQueue.<init>(ActiveMQTempQueue.java:35)
        at 
org.apache.activemq.command.ActiveMQDestination.transform(ActiveMQDestination.java:121)
        at 
org.apache.activemq.command.ActiveMQMessage.setJMSDestination(ActiveMQMessage.java:222)
        at 
org.apache.activemq.network.jms.TopicBridge.sendMessage(TopicBridge.java:91)
        at 
org.apache.activemq.network.jms.DestinationBridge.onMessage(DestinationBridge.java:146)
        at 
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1088)
        at 
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:127)
        at 
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:197)
        at 
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
        at 
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)


 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to