It seems that the problem has to do with messages staying in 'delivering' mode:
When application code called by the MDB throws an exception, it seems that the message does not leave the state 'delivering'. A DLQ has been configured, and the messages end up succesfully over there, but still the original Queue has the problem.
Code-wise, the MDB will only do a
context.setRollbackOnly();
when it encounters a JMSException (I hope that's okay).
Trying to remove all messages through the jmx console does not work as 'messages are still being delivered', with the exception
java.lang.IllegalStateException: Cannot remove references while deliveries are in progress (Channel 13360), there are 1
And when stopping and starting the MDB (also when starting a server on the same db) we get the exception
java.lang.IllegalStateException: Cannot remove references while deliveries are in progress (Channel 13360), there are 1
java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:903)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getObject(WrappedResultSet.java:750)
at org.jboss.messaging.core.impl.JDBCPersistenceManager.loadFromStart(JDBCPersistenceManager.java:999)
at org.jboss.messaging.core.impl.PagingChannelSupport.load(PagingChannelSupport.java:211)
at org.jboss.jms.server.destination.QueueService.startService(QueueService.java:105)
Starting the Queue, and in fact, the whole messageing subsystem, can then only be done after SQL deleteing the jbm_msg and jbm_msg_ref tables.
Hope this information helps