WebSphere Commerce suite - Exception when trying to send message to an MQ-queue

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Commerce suite > December 2004 > Exception when trying to send message to an MQ-queue





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Exception when trying to send message to an MQ-queue
VIlle

2004-12-06, 5:52 pm

Hi!

I'm trying to send a message to an MQ-queue in a task command but I cant
seem to get it right. When I try to send the message to the queue I get the
following exception:

[2004-12-06 17:25:37:969 CET] 7e3b33c4 TransactionIm E WTRN0062E: An illegal
attempt to use multiple resources that have only one-phase capability has
occurred within a global transaction.

Here's my code:

jndiContext = new InitialContext();
queueConnectionFactory = (QueueConnectionFactory)
jndiContext.lookup("JMSQueueConnectionFactory");
queueSend = (Queue) jndiContext.lookup("JMSOutboundInventoryQueue");
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);

QueueSender sender = queueSession.createSender(queueSend);
sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
queueConnection.start();

TextMessage sendMessage = queueSession.createTextMessage("This is a test");
sender.send(sendMessage);
sender.close();


Any help would be greatly appreciated!

/Anders


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com