[jboss-user] [Messaging, JMS & JBossMQ] - JMS Messaga in MBean (JBOSS Service)

niranjanc do-not-reply at jboss.com
Mon Aug 14 09:40:53 EDT 2006


Hi,
 is it possible to receive JMS Messaga in MBean (JBOSS Service) ?  
I added the following code in the start()  method of My MBean and during register with Message Consumer I got the following excpetion 

   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();


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)



Thanks in advance,
Niranjan

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

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



More information about the jboss-user mailing list