0 Replies Latest reply on Aug 11, 2006 10:56 AM by Niranjan Chelliah

    How do I receive JMS Message from the MBEAN .

    Niranjan Chelliah Newbie

      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