I had a bug in an older version of Artemis, and the newer broker would not be able to open compacting, leading to this exception:
AMQ142032: Error reading journal file: java.lang.IllegalArgumentException: Keys and values must be >= 0
at org.apache.activemq.artemis.utils.collections.ConcurrentLongHashSet.checkBiggerEqualZero(ConcurrentLongHashSet.java:428) [artemis-commons-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.utils.collections.ConcurrentLongHashSet.contains(ConcurrentLongHashSet.java:119) [artemis-commons-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.core.journal.impl.AbstractJournalUpdateTask.containsRecord(AbstractJournalUpdateTask.java:247) [artemis-journal-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.core.journal.impl.JournalCompactor.onReadUpdateRecordTX(JournalCompactor.java:484) [artemis-journal-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.core.journal.impl.JournalImpl.readJournalFile(JournalImpl.java:849) [artemis-journal-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.core.journal.impl.JournalImpl.compact(JournalImpl.java:1868) [artemis-journal-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.commands.tools.journal.CompactJournal.compactJournal(CompactJournal.java:79) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.commands.tools.journal.CompactJournal.compactJournals(CompactJournal.java:47) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.commands.tools.journal.CompactJournal.execute(CompactJournal.java:38) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:157) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:105) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:132) [artemis-cli-2.20.0-SNAPSHOT.jar:2.20.0-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) [java.base:]
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.20.0-SNAPSHOT]
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.20.0-SNAPSHOT]