We
have a JMS Listener external to jboss and am getting an exception every time we
attempt to connect to JBoss. The exception is "That destination queue does
not exists". We are using jboss 2.2.2 w/ tomcat
3.2.2. The initial code was using swiftmq but since we heavily into
jboss it's time we use it's jms features. Based on JNDI view it appears
the topic and queue exists, the issue is with the durable subscriber. Any
assistance is greatly appreciated. I think I provided everything;
there were no modifications to the jboss.jcml.
jbossmq.xml
<Topic>
<Name>Exceptions</Name>
</Topic>
<Queue>
<Name>JMSListener1</Name>
</Queue>
<UserManager>
<User>
<Name>JMSListener1</Name>
<Password></Password>
<Id>DurableSubscriberExample</Id>
<DurableSubscription>
<Name>DurableSubscriberExample</Name>
<TopicName>Exceptions</TopicName>
</DurableSubscription>
</User>
<Name>Exceptions</Name>
</Topic>
<Queue>
<Name>JMSListener1</Name>
</Queue>
<UserManager>
<User>
<Name>JMSListener1</Name>
<Password></Password>
<Id>DurableSubscriberExample</Id>
<DurableSubscription>
<Name>DurableSubscriberExample</Name>
<TopicName>Exceptions</TopicName>
</DurableSubscription>
</User>
The
queue and topic exist via JNDIView
+- queue
(class: org.jnp.interfaces.NamingContext)
| +- JMSListener1 (class: org.jbossmq.SpyQueue)
+- topic (class: org.jnp.interfaces.NamingContext)
| +- Exceptions (class: org.jbossmq.SpyTopic)
| +- JMSListener1 (class: org.jbossmq.SpyQueue)
+- topic (class: org.jnp.interfaces.NamingContext)
| +- Exceptions (class: org.jbossmq.SpyTopic)
The
Code
JMSListener jmsListener =
getListener((String)settings.get("listenerClass")); Hashtable env = new
Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,(String)settings.get("INITIAL_CONTEXT_FACTORY"));
env.put(Context.PROVIDER_URL,(String)settings.get("PROVIDER_URL"));
String url_pkg_prefixes = (String)settings.get("URL_PKG_PREFIXES");
if( url_pkg_prefixes != null ) {
env.put("java.naming.rmi.security.manager", "yes");
env.put( Context.URL_PKG_PREFIXES, url_pkg_prefixes );
}
jndiContext = new InitialContext(env);
env.put(Context.INITIAL_CONTEXT_FACTORY,(String)settings.get("INITIAL_CONTEXT_FACTORY"));
env.put(Context.PROVIDER_URL,(String)settings.get("PROVIDER_URL"));
String url_pkg_prefixes = (String)settings.get("URL_PKG_PREFIXES");
if( url_pkg_prefixes != null ) {
env.put("java.naming.rmi.security.manager", "yes");
env.put( Context.URL_PKG_PREFIXES, url_pkg_prefixes );
}
jndiContext = new InitialContext(env);
topicConnectionFactory =
(TopicConnectionFactory)
jndiContext.lookup("TopicConnectionFactory");
topicConnection = topicConnectionFactory.createTopicConnection();
topicConnection.setClientID((String)settings.get("clientID"));
topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
topic = topicSession.createTopic((String)settings.get("topic"));
// topicSubscriber = topicSession.createDurableSubscriber(topic, (String)settings.get("name"),null,false);
topicSubscriber = topicSession.createDurableSubscriber(topic, (String)settings.get("name")); // <-- line 91
jndiContext.lookup("TopicConnectionFactory");
topicConnection = topicConnectionFactory.createTopicConnection();
topicConnection.setClientID((String)settings.get("clientID"));
topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
topic = topicSession.createTopic((String)settings.get("topic"));
// topicSubscriber = topicSession.createDurableSubscriber(topic, (String)settings.get("name"),null,false);
topicSubscriber = topicSession.createDurableSubscriber(topic, (String)settings.get("name")); // <-- line 91
Input to the code
<JMS-Listener>
<param name="listenerClass" value="com.pdsisoft.staffeasy.exception.CriticalErrorListener" />
<param name="INITIAL_CONTEXT_FACTORY" value="org.jnp.interfaces.NamingContextFactory" />
<param name="PROVIDER_URL" value="localhost:1099" />
<param name="URL_PKG_PREFIXES" value="org.jboss.naming" />
<param name="clientID" value="JMSListener1" />
<param name="topic" value="Exceptions" />
<param name="name" value="JMSListener1" />
<param name="error_log_file" value="/opt/log/error_log_file.dat" />
<param name="listenerClass" value="com.pdsisoft.staffeasy.exception.CriticalErrorListener" />
<param name="INITIAL_CONTEXT_FACTORY" value="org.jnp.interfaces.NamingContextFactory" />
<param name="PROVIDER_URL" value="localhost:1099" />
<param name="URL_PKG_PREFIXES" value="org.jboss.naming" />
<param name="clientID" value="JMSListener1" />
<param name="topic" value="Exceptions" />
<param name="name" value="JMSListener1" />
<param name="error_log_file" value="/opt/log/error_log_file.dat" />
</JMS-Listener>
Exception
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
javax.jms.JMSException: Cannot subscribe to this Destination
at org.jbossmq.SpyConnection.failureHandler(SpyConnection.java:318)
at org.jbossmq.SpyConnection.addConsumer(SpyConnection.java:440)
at org.jbossmq.SpySession.addConsumer(SpySession.java:416)
at org.jbossmq.SpyTopicSession.createDurableSubscriber(SpyTopicSession.java:89)
at com.pdsisoft.core.util.JMSListener.main(JMSListener.java:91)
closing down connection
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
javax.jms.JMSException: Cannot subscribe to this Destination
at org.jbossmq.SpyConnection.failureHandler(SpyConnection.java:318)
at org.jbossmq.SpyConnection.addConsumer(SpyConnection.java:440)
at org.jbossmq.SpySession.addConsumer(SpySession.java:416)
at org.jbossmq.SpyTopicSession.createDurableSubscriber(SpyTopicSession.java:89)
at com.pdsisoft.core.util.JMSListener.main(JMSListener.java:91)
closing down connection
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: That destination queue does not exist
javax.jms.JMSException: That destination queue does not exist
<<no stack trace available>>
Run the listener batch
set J2EE_HOME=/usr/j2ee
java -classpath ./;staffeasy-1.0.0.jar;%JAVA_HOME%lib/tools.jar;%JAVA_HOME%jre/lib/rt.jar;/opt/jboss/client/jbossmq-client.jar;/opt/jboss/lib/ext/jms.jar;/opt/jboss/client/jnp-client.jar;/opt/jboss/client/jbosssx-client.jar;/opt/jboss/client/jta-spec1_0_1.jar;/opt/xerces/xerces.jar com.pdsisoft.staffeasy.exception.CriticalErrorListener ../jms/JMSListener.xml
java -classpath ./;staffeasy-1.0.0.jar;%JAVA_HOME%lib/tools.jar;%JAVA_HOME%jre/lib/rt.jar;/opt/jboss/client/jbossmq-client.jar;/opt/jboss/lib/ext/jms.jar;/opt/jboss/client/jnp-client.jar;/opt/jboss/client/jbosssx-client.jar;/opt/jboss/client/jta-spec1_0_1.jar;/opt/xerces/xerces.jar com.pdsisoft.staffeasy.exception.CriticalErrorListener ../jms/JMSListener.xml
