hi,

i had this same problem, not sure why but i had to set the NON_PERSISTENT
mode in the send method,
public void send(Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
colin....

>>>>>>>>
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


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to