I meet a problem ,please refer to the following codes
Object tmp = iniCtx.lookup(TOPIC_CONNECTION_FACTORY_KEY); String connectStatusTopicName = ConfigUtils.getProperties().getProperty("ConnectStatusTopicName", "TopicStatus"); TopicConnectionFactory tcf = (TopicConnectionFactory) tmp; topic2 = (Topic) iniCtx.lookup(connectStatusTopicName); conn = tcf.createTopicConnection(); session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE); conn.start(); TopicSubscriber topicSubscriber = session.createDurableSubscriber( topic2, "health"); topicSubscriber.setMessageListener(receiver2);
The "java:/JmsXA" implementation of the connection factory enforces the "The following methods may only be used by application components
executing in the application client container:" restrictions from section 6.6 of the j2ee 1.4 spec. None of the methods listed in that section can be used by application components. The message listener would have to be an mdb.