Details
-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
JBoss A-MQ 6.1
-
None
-
Workaround Exists
-
Description
The error message is misleading, and even with debug turn on is not much help. Something like missing statements would be nice."2014-04-16 16:34:26,649 | ERROR | node1 failed to release lease: java.lang.NullPointerException | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main java.lang.NullPointerException at org.apache.activemq.store.jdbc.LeaseDatabaseLocker.releaseLease(LeaseDatabaseLocker.java:154)"
is not the true error lock, in fact it is couple line above:2014-04-16 16:34:23,529 | INFO | node1 attempting to acquire exclusive lease to become the master | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main
2014-04-16 16:34:23,531 | ERROR | Failed to start Apache ActiveMQ ([localhost, null], java.lang.NullPointerException) | org.apache.activemq.broker.BrokerService | main
2014-04-16 16:34:23,536 | INFO | Apache ActiveMQ 5.9.0.redhat-610379 (localhost, null) is shutting down | org.apache.activemq.broker.BrokerService | mainWhat it means is that it can't get the lock. When the master broker loses the JDBC connection it is unable to refresh the lease. The default behavior is for the broker to shutdown when a database exception is encountered, and hence the null pointer exception.What is missing in the config is the statements part.<persistenceAdapter>
<kahaDB directory="${activemq.data} /kahadb">
<locker>
<lease-database-locker lockAcquireSleepInterval="2000" dataSource="#oracle-ds" leaseHolderId="node1" >
<statements>
<!-- Default locker attributes and SQL statements may be overridden here
using one or more <statements attribute_or_statement="value"/> entries: -->
<statements lockTableName="activemq_lock"/>
</statements>
</lease-database-locker>
</locker>
</kahaDB>
</persistenceAdapter>It is documented under "Lease Database Locker" http://activemq.apache.org/pluggable-storage-lockers.html and about kahadb with lease locker.