[jboss-user] [Management, JMX/JBoss] - How do I receive JMS Message from the MBEAN .

niranjanc do-not-reply at jboss.com
Fri Aug 11 10:56:24 EDT 2006


How do I receive JMS Message from the MBEAN .


Following code is throwing this Exception when I try to register with messageConsumer

javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
  | at org.jboss.resource.adapter.jms.JmsSession.checkStrict(JmsSession.java:542)
  | at org.jboss.resource.adapter.jms.JmsMessageConsumer.setMessageListener(JmsMessageConsumer.java:136)



   Context context = new InitialContext();	
  |    ConnectionFactory connectionFactory_ = (ConnectionFactory) context
  | 	.lookup("TopicConnectionFactory");
  |    Topic topic_ = (Topic) context.lookup(UM_MESSAGEING_TOPIC);
  |    Connection conection_ = connectionFactory_.createConnection();    
  |     Session session_ = conection_.createSession(false
  | 	Session.AUTO_ACKNOWLEDGE);
  |    MessageConsumer messageConsumer_ = session_.createConsumer (topic_);
  |   messageConsumer_.setMessageListener(callback); 
  | conection_.start();


Thanks in advance,
Niranjan

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964639#3964639

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964639



More information about the jboss-user mailing list