Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 30268 invoked from network); 15 Apr 2010 13:54:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Apr 2010 13:54:09 -0000 Received: (qmail 5461 invoked by uid 500); 15 Apr 2010 13:54:09 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 5417 invoked by uid 500); 15 Apr 2010 13:54:09 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 5409 invoked by uid 99); 15 Apr 2010 13:54:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 13:54:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 13:54:06 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3FDrjnX020936 for ; Thu, 15 Apr 2010 09:53:45 -0400 (EDT) Message-ID: <13994140.13511271339625234.JavaMail.jira@thor> Date: Thu, 15 Apr 2010 09:53:45 -0400 (EDT) From: "Dejan Bosanac (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-2696) DefaultJDBCAdapter returns incorrect value that prevents ActiveMQ from starting. In-Reply-To: <6337553.11051271248243617.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dejan Bosanac updated AMQ-2696: ------------------------------- Fix Version/s: 5.4.0 Affects Version/s: (was: 5.3.1) > DefaultJDBCAdapter returns incorrect value that prevents ActiveMQ from starting. > -------------------------------------------------------------------------------- > > Key: AMQ-2696 > URL: https://issues.apache.org/activemq/browse/AMQ-2696 > Project: ActiveMQ > Issue Type: Bug > Components: Message Store > Affects Versions: 5.4.0 > Environment: Vista 64bit > Reporter: Andy > Assignee: Dejan Bosanac > Priority: Critical > Fix For: 5.4.0 > > > org.apache.activemq.store.jdbcJDBCPersistenceAdapter.getLastMessageBrokerSequenceId() calls: > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter: > The call to doGetLastMessageStoreSequenceId will return the max acks table id if the max msgs id is less. > The result is used to seed the sequenceGenerator: > long seq = getAdapter().doGetLastMessageStoreSequenceId(c); > sequenceGenerator.setLastSequenceId(seq); > However the next call to set the brokerSeq variable will fail if the seq variable has been seeded with the max acks id, as 'doGetMessageById' expects a valid msgs id. > long brokerSeq = 0; > if (seq != 0) { > Message last = (Message)wireFormat.unmarshal(new ByteSequence(getAdapter().doGetMessageById(c, seq))); > brokerSeq = last.getMessageId().getBrokerSequenceId(); > } > return brokerSeq; > If 'seq' is not a valid msgs id (I presume because the message has expired and/or been removed) then this causes a NullPointerException in ByteSequence, which is not caught, and this leads to a complete failure to start ActiveMQ. > The solution is not simple if the tables are in production, and is compounded even further by durable subscribers that cannot simply be deleted from the acks table. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira