You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pepgrifell <pe...@yahoo.es> on 2012/05/14 16:54:52 UTC

error "This producer can only send messages to..." in JBoss6 with embedded ActiveMQ4.1.1

hi,

We are migrating from JBoss4.2.3 to JBoss6.1.  We have ActiveMQ integrated
in JBoss 4 and it works ok. 
Following this link:  http://activemq.apache.org/outbound-communication.html
http://activemq.apache.org/outbound-communication.html  I have migrated to
JBoss 6.  The application is deployed correctly but when I try to send a
message to a queue I get this error:

Caused by: java.lang.UnsupportedOperationException: This producer can only
send messages to: HomeTAOEventsQueue
	at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:459)
[:4.1.1]
	at
org.apache.activemq.ActiveMQQueueSender.send(ActiveMQQueueSender.java:139)
[:4.1.1]

This error is thrown in the class ActiveMQMessageProducer. I have debbuged
the application and when the method ActiveMQMessageProducer.send is called,
it does this comparation (can't find how to tag code):


            public void send(Destination destination, Message message, int
deliveryMode, int priority, long timeToLive)
            throws JMSException {
        checkClosed();
        if (destination == null) {
            if( info.getDestination() == null ) {
                throw new UnsupportedOperationException("A destination must
be specified.");
            }
            throw new InvalidDestinationException("Don't understand null
destinations");
        }

        ActiveMQDestination dest; 
        if( destination == info.getDestination() ) {
            dest = (ActiveMQDestination) destination;
        } else  if ( info.getDestination() == null ) {
            dest = ActiveMQDestination.transform(destination);
        } else {
            throw new UnsupportedOperationException("This producer can only
send messages to: " + this.info.getDestination().getPhysicalName());
        }
        if (dest == null) {
            throw new JMSException("No destination specified");
        }
        
        this.session.send(this, dest, message, deliveryMode, priority,
timeToLive);
        stats.onMessage();            
    }


The code 'destination == info.getDestination()'  returns false !

'info.getDestination()' returns an ActiveMQQueue object instantiaded in
constructor and its physicalName is 'HomeTAOEventsQueue'.  

'destination' is a ActiveMQQueue passed as a parameter when calling the
'sender' method. Its physicalName is 'HomeTAOEventsQueue'.  

In the line I posted above, the comparision returns "false" but I don't know
why ... 

Any help ?
Thanks !

pd: I can post configuration files if needed.

--
View this message in context: http://activemq.2283324.n4.nabble.com/error-This-producer-can-only-send-messages-to-in-JBoss6-with-embedded-ActiveMQ4-1-1-tp4632351.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: error "This producer can only send messages to..." in JBoss6 with embedded ActiveMQ4.1.1

Posted by Torsten Mielke <to...@fusesource.com>.
Hello,

Not sure about your problem but ActiveMQ 4.1 is really old. You may want to consider upgrading to the latest version of ActiveMQ 5.5.1.

If the same destination is used to create the ActiveMQMessageProducer as well as when sending a message, this should not cause any problems. 


Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com


On May 14, 2012, at 4:54 PM, pepgrifell wrote:

> hi,
> 
> We are migrating from JBoss4.2.3 to JBoss6.1.  We have ActiveMQ integrated
> in JBoss 4 and it works ok. 
> Following this link:  http://activemq.apache.org/outbound-communication.html
> http://activemq.apache.org/outbound-communication.html  I have migrated to
> JBoss 6.  The application is deployed correctly but when I try to send a
> message to a queue I get this error:
> 
> Caused by: java.lang.UnsupportedOperationException: This producer can only
> send messages to: HomeTAOEventsQueue
> 	at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:459)
> [:4.1.1]
> 	at
> org.apache.activemq.ActiveMQQueueSender.send(ActiveMQQueueSender.java:139)
> [:4.1.1]
> 
> This error is thrown in the class ". I have debbuged
> the application and when the method ActiveMQMessageProducer.send is called,
> it does this comparation (can't find how to tag code):
> 
> 
>            public void send(Destination destination, Message message, int
> deliveryMode, int priority, long timeToLive)
>            throws JMSException {
>        checkClosed();
>        if (destination == null) {
>            if( info.getDestination() == null ) {
>                throw new UnsupportedOperationException("A destination must
> be specified.");
>            }
>            throw new InvalidDestinationException("Don't understand null
> destinations");
>        }
> 
>        ActiveMQDestination dest; 
>        if( destination == info.getDestination() ) {
>            dest = (ActiveMQDestination) destination;
>        } else  if ( info.getDestination() == null ) {
>            dest = ActiveMQDestination.transform(destination);
>        } else {
>            throw new UnsupportedOperationException("This producer can only
> send messages to: " + this.info.getDestination().getPhysicalName());
>        }
>        if (dest == null) {
>            throw new JMSException("No destination specified");
>        }
> 
>        this.session.send(this, dest, message, deliveryMode, priority,
> timeToLive);
>        stats.onMessage();            
>    }
> 
> 
> The code 'destination == info.getDestination()'  returns false !
> 
> 'info.getDestination()' returns an ActiveMQQueue object instantiaded in
> constructor and its physicalName is 'HomeTAOEventsQueue'.  
> 
> 'destination' is a ActiveMQQueue passed as a parameter when calling the
> 'sender' method. Its physicalName is 'HomeTAOEventsQueue'.  
> 
> In the line I posted above, the comparision returns "false" but I don't know
> why ... 
> 
> Any help ?
> Thanks !
> 
> pd: I can post configuration files if needed.
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/error-This-producer-can-only-send-messages-to-in-JBoss6-with-embedded-ActiveMQ4-1-1-tp4632351.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.