tags:

views:

17

answers:

0

Hi,

I get the following exceptions from my java code, and I've no idea why.

.javax.jms.JMSException: [C4036]: A server error occurred.
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithAck(ProtocolHandler.java:307)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.acknowledge(ProtocolHandler.java:1593)
at com.sun.messaging.jmq.jmsclient.SessionImpl.doAcknowledge(SessionImpl.java:724)
at com.sun.messaging.jmq.jmsclient.SessionImpl.transactedAcknowledge(SessionImpl.java:668)
at com.sun.messaging.jmq.jmsclient.SessionImpl.acknowledge(SessionImpl.java:621)
at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl.deliverAndAcknowledge(MessageConsumerImpl.java:265)
at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl.onMessage(MessageConsumerImpl.java:207)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:57)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:139)
at java.lang.Thread.run(Thread.java:595)

My code...

  Hashtable<String, String> env = new Hashtable<String, String>();
  env.put("java.naming.factory.initial","com.sun.jndi.fscontext.RefFSContextFactory");
  env.put("java.naming.provider.url","file:///var/imq/imq_admin_objects");
  Context ctx = new InitialContext(env);

  QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("factory");
  Queue queue = (Queue)ctx.lookup("republish");
  ctx.close();

  QueueConnection connection = factory.createQueueConnection();
  QueueSession session = connection.createQueueSession(true, QueueSession.SESSION_TRANSACTED);
  MessageConsumer createConsumer = session.createConsumer(queue);

  createConsumer.setMessageListener(new MessageListener()
  {
    public void onMessage(Message arg0)
    {          System.err.print(".");   }
  });
  connection.start();

I've no idea why, it seems to happen more when I place a large number of messages on the queue.

Can anyone help?

Jeff Porter