I have two instances of JBOSS 4.0.2 Application Server - each running on
different machines.
I configured a Queue with a JNDI name queue/SampleQueue in "Machine A"
and started the "Machine A" giving the --host=
I deployed a servlet on JBOSS running in Machine B. This servlet looked-up the
Queue deployed on "Machine A" . It failed with exception
javax.jms.InvalidDestinationException: The destination QUEUE.SampleQueue does
not exist
However when the same code was run as a stand-alone java program, it worked.
Is this a bug in 4.0.2 or is my configuration wrong?
Please help.
The Servlet Code:
public void writeToJMS() {
try {
java.util.Properties jp = new java.util.Properties();
jp.put(Context.PROVIDER_URL, "jnp://10.250.11.26:1099");
jp.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
Context context = new javax.naming.InitialContext(jp);
QueueConnectionFactory qcf =
(QueueConnectionFactory)
context.lookup("java:/XAConnectionFactory");
Queue ioQueue = (Queue) context.lookup("queue/SampleQueue");
QueueConnection qc = qcf.createQueueConnection();
QueueSession qs =
qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender = qs.createSender(ioQueue);
System.out.println("Got the queue 1");
TextMessage outMessage = qs.createTextMessage();
System.out.println("Adding Text");
outMessage.setText("hello");
// Ask the QueueSender to send the message we have created
System.out.println(
"Sending the message to " + ioQueue.getQueueName());
System.out.println(ioQueue.toString());
queueSender.send(outMessage);
System.out.println(
"Sent ....... " );
} catch (Exception ex) {
ex.printStackTrace();
}
}
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3884468#3884468
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3884468
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user