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

    JMS Messaga in MBean (JBOSS Service)

    Niranjan Chelliah Newbie

      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
       Topic topic_ = (Topic) context.lookup(UM_MESSAGEING_TOPIC);
       Connection conection_ = connectionFactory_.createConnection();
       Session session_ = conection_.createSession(false
       MessageConsumer messageConsumer_ = session_.createConsumer (topic_);

      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,