Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2285 JBOSS 4.0.2 JMS seems to not working when setup as remote.

v4.0
closed-postponed
nobody
JBossMQ (152)
5
2014-08-13
2005-07-12
sampr_s
No

The JBOSS MQ seems to have a problem for the
following Scenario.

1) JBOSS MQ setup on machine A

2) Servlet deployed on JBOSS AS in machine B

3) Servlet looks-up for the MQ deployed on Machine A,
following exception is thrown:
javax.jms.InvalidDestinationException: The destination
QUEUE.SampleQueue does not exist !

4) A client program ( a stand-alone) is created with the
same code as in servlet and run on machine B. It works

The 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.interface
s.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 ....... " );
//qs.commit();

} catch (Exception ex) {
ex.printStackTrace();
}
}

Discussion

  • Adrian Brock
    Adrian Brock
    2005-07-12

    Logged In: YES
    user_id=9459

    All issues have been moved to http://jira.jboss.com. Existing
    issues have been moved. New issues will be closed with this
    canned reponse.

     
  • Adrian Brock
    Adrian Brock
    2005-07-12

    • status: open --> closed-postponed