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);
all is the default configure.
when TOPIC_CONNECTION_FACTORY_KEY is "ConnectionFactory" ,it's ok.
but when TOPIC_CONNECTION_FACTORY_KEY is "java:/JmsXA",
I will meet the following problem caused by "topicSubscriber.setMessageListener(receiver2);"
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:531)
at org.jboss.resource.adapter.jms.JmsMessageConsumer.setMessageListener(JmsMessageConsumer.java:135)
......................................
after I checked the J2ee1.4 spec section6.6, I still don't understand .
can you help me ???
thank you .l
"