Hi all,
I'm using a QueueRequestor to send a request and get a response from a bean.
Another client receive the JMS request, and sends it to the reply to
destination. I get the following error, while trying to send it:
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: Cannot write a persistent message to a
temporary destination!
javax.jms.JMSException: Cannot write a persistent message to a temporary
destination!
<<no stack trace available>>
java.rmi.RemoteException: ; nested exception is:
javax.jms.JMSException: Cannot write a persistent message to a
temporary destination!
javax.jms.JMSException: Cannot write a persistent message to a temporary
destination!
<<no stack trace available>>
javax.jms.JMSException: Cannot send a message to the JMS provider
at org.jbossmq.SpyConnection.failureHandler(SpyConnection.java:318)
at org.jbossmq.SpyConnection.sendToServer(SpyConnection.java:390)
at org.jbossmq.SpySession.sendMessage(SpySession.java:383)
at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:95)
at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:59)
at jmsclient.Jms.doMain(Jms.java:52)
at jmsclient.Jms.main(Jms.java:16)
Here is my client code :
try {
ctx = new InitialContext() ;
queue = (Queue) ctx.lookup(queueName) ;
factory = (QueueConnectionFactory)
ctx.lookup("QueueConnectionFactory") ;
connection = factory.createQueueConnection() ;
session = connection.createQueueSession(false,
Session.CLIENT_ACKNOWLEDGE) ;
receiver = session.createReceiver(queue) ;
sender = session.createSender(queue) ;
connection.start() ;
while (true) {
msg = receiver.receive() ;
System.out.println("Message received: " +
msg.toString()) ;
if (msg.getJMSReplyTo() != null) {
outmsg = session.createMessage() ;
outmsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT) ;
sender.send((Queue)
msg.getJMSReplyTo(), outmsg) ;
}
msg.acknowledge() ;
}
} catch (Exception ex) {
...
Since I actually set the DeliveryMode to NON_PERSISTENT, I don't understand
what cause the error. Any help/suggestion is welcome.
Thanks
Olivier
**** Important Notice to Recipients ****
It is important that you do not use e-mail to request, authorize or effect
the purchase or sale of any security or commodity, to send fund transfer
instructions, or to effect any other transactions. Any such request,
orders, or instructions that you send will not be accepted and will not be
processed by Morgan Stanley.
****************************************
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user