From 185b0cb2a888b37dfd999e05e7211853a5bbe0ac Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Mon, 10 Apr 2017 12:04:46 +0100 Subject: [PATCH 1/2] ARTEMIS-1105 null pointer when replicating paged messages https://issues.apache.org/jira/browse/ARTEMIS-1105 --- .../activemq/artemis/core/paging/impl/PagedMessageImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java index b770623754..0b207ec403 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java @@ -73,8 +73,8 @@ public class PagedMessageImpl implements PagedMessage { LargeServerMessage lgMessage = storage.createLargeMessage(); ActiveMQBuffer buffer = ActiveMQBuffers.wrappedBuffer(largeMessageLazyData); - LargeMessagePersister.getInstance().decode(buffer, lgMessage); - ((LargeServerMessage) message).incrementDelayDeletionCount(); + lgMessage = LargeMessagePersister.getInstance().decode(buffer, lgMessage); + lgMessage.incrementDelayDeletionCount(); this.message = lgMessage; largeMessageLazyData = null; } From 4a73d8296451f2e1031cdaa84d1ba15feebcacf3 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 10 Apr 2017 12:25:07 -0400 Subject: [PATCH 2/2] ARTEMIS-1105 Adding setPaged that was missed during the refactoring --- .../activemq/artemis/core/paging/impl/PagedMessageImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java index 0b207ec403..d7bd05c6aa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java @@ -75,6 +75,7 @@ public class PagedMessageImpl implements PagedMessage { ActiveMQBuffer buffer = ActiveMQBuffers.wrappedBuffer(largeMessageLazyData); lgMessage = LargeMessagePersister.getInstance().decode(buffer, lgMessage); lgMessage.incrementDelayDeletionCount(); + lgMessage.setPaged(); this.message = lgMessage; largeMessageLazyData = null; }