RMQConnectionFactory.getReference() and RMQDestination.getReference() return javax.naming.Reference instances that are not 'convertible' back to RMQConnectionFactory/RMQDestination.
There are 2 problems:
-
The javax.naming.Reference instances do not have 'classFactory' property set. As a result an instance of RMQConnectionFactory/RMQDestination can be bound into a naming context. But it cannot be retrieved back from JNDI. Instead an instance of javax.naming.Reference is retrieved.
-
Even if RMQObjectFactory is used as 'classFactory' in javax.naming.Reference instances, it is still not going to work. The reason is: RMQConnectionFactory/RMQDestination use their class names as 'className' property of javax.naming.Reference. RMQObjectFactory does not recognize these class names as valid. This class has the following comment (and the code that does what the comment says):
/*
* Valid class names are:
* javax.jms.ConnectionFactory
* javax.jms.QueueConnectionFactory
* javax.jms.TopicConnectionFactory
* javax.jms.Topic
* javax.jms.Queue
*
*/