MessageBroker.getMessageBroker(null) getting null pointer Exception
I am creating Dynamic Destinations
MessageBroker broker = MessageBroker.getMessageBroker(null);
MessageService开发者_运维技巧 service = (MessageService) broker.getService("message-service");
MessageDestination destination = (MessageDestination) service.createDestination("Group1");
if (service.isStarted()) {
destination.start();
}
But I am getting Null Pointer Exception MessageBroker broker = MessageBroker.getMessageBroker(null);
Can Anyone Help Me
You may be using Spring blazeds integration. Flex, by default uses "__default__"
as the messageBroker id in which case your MessageBroker.getMessageBroker(null)
holds true. However, Spring uses "_messageBroker"
as the broker id. Therefore you might have to use
MessageBroker broker=MessageBroker.getMessageBroker("_messageBroker");
This URL says it even better....
http://forum.springsource.org/showthread.php?t=72964
MessageBroker broker=MessageBroker.getMessageBroker(BeanIds.MESSAGE_BROKER);
精彩评论