Hi all, I'm using tomee plus (I've tried 1.0.0 plus and 1.0.1 plus snashot from June 7) and I'm seeing an issue. Before I open a bug, I thought I'd ask and see if anyone has a workaround or has reported this issue (I searched and didn't find it). I'd rather not re-configure tomee to use some other datasource for persistence, I like the built-in one especially while I'm developing and testing.
I have a JMS queue in my application that I use to send/process textmessages and if I shutdown/restart tomee while there are messages in the queue they get persisted, but then when the server starts I get the following error and the ActiveMQ JMS Broker fails to start. WARNING: JDBC Failure: incompatible data type in conversion: from SQL type OTHER to [B, value: instance of org.hsqldb.types.JavaObjectData java.sql.SQLSyntaxErrorException: incompatible data type in conversion: from SQL type OTHER to [B, value: instance of org.hsqldb.types.JavaObjectData at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.Util.throwError(Unknown Source) at org.hsqldb.jdbc.JDBCResultSet.getColumnInType(Unknown Source) at org.hsqldb.jdbc.JDBCResultSet.getBytes(Unknown Source) at org.apache.commons.dbcp.DelegatingResultSet.getBytes(DelegatingResultSet.java:241) at org.apache.commons.dbcp.DelegatingResultSet.getBytes(DelegatingResultSet.java:241) at org.apache.activemq.store.jdbc.adapter.BytesJDBCAdapter.getBinaryData(BytesJDBCAdapter.java:38) at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doGetMessageById(DefaultJDBCAdapter.java:194) at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:234) at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:145) at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:122) at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1833) at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1824) at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1781) at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:766) at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:296) at org.apache.activemq.broker.BrokerService.start(BrokerService.java:493) at org.apache.openejb.resource.activemq.ActiveMQ5Factory$1.run(ActiveMQ5Factory.java:126) Caused by: org.hsqldb.HsqlException: incompatible data type in conversion: from SQL type OTHER to [B, value: instance of org.hsqldb.types.JavaObjectData at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.error.Error.error(Unknown Source) ... 16 more Here's some sample code to reproduce the problem. Put this class in an otherwise empty web app: package org.jschoudt.test; import javax.annotation.Resource; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageProducer; import javax.jms.Queue; import javax.jms.Session; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; @WebListener public class ConfigListener implements ServletContextListener { @Resource ConnectionFactory cf; @Resource(name = "somequeue") Queue queue; public ConfigListener() {} public void contextInitialized(ServletContextEvent event) { Connection conn = null; Session session = null; MessageProducer messageProducer = null; try { conn = cf.createConnection(); conn.start(); session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); messageProducer = session.createProducer(queue); Message m = session.createTextMessage("{'foo':'bar'}"); messageProducer.send(m); event.getServletContext().log("Message sent"); } catch (Exception e) { event.getServletContext().log("Error sending message", e); } finally { if (messageProducer != null) { try { messageProducer.close(); } catch (JMSException e) { event.getServletContext().log( "Error closing messageProducer", e); } } if (session != null) { try { session.close(); } catch (JMSException e) { event.getServletContext().log("Error closing session", e); } } if (conn != null) { try { conn.close(); } catch (JMSException e) { event.getServletContext() .log("Error closing connection", e); } } } } public void contextDestroyed(ServletContextEvent event) {} } -- View this message in context: http://openejb.979440.n4.nabble.com/Default-JMS-Persistence-fails-on-restart-if-messages-are-left-in-a-queue-tp4655619.html Sent from the OpenEJB User mailing list archive at Nabble.com.