0 Replies Latest reply on Aug 14, 2006 9:40 AM by Niranjan Chelliah

    JMS Messaga in MBean (JBOSS Service)

    Niranjan Chelliah Newbie

      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