diff --git a/nucleus/core/kernel/src/main/java/org/glassfish/kernel/event/EventsImpl.java b/nucleus/core/kernel/src/main/java/org/glassfish/kernel/event/EventsImpl.java index 8f152f0aa4b..2c25418fcc5 100644 --- a/nucleus/core/kernel/src/main/java/org/glassfish/kernel/event/EventsImpl.java +++ b/nucleus/core/kernel/src/main/java/org/glassfish/kernel/event/EventsImpl.java @@ -37,6 +37,7 @@ * only if the new code is made subject to such option by the copyright * holder. */ +// Portions Copyright 2024 Payara Foundation and/or affiliates package org.glassfish.kernel.event; @@ -47,6 +48,8 @@ import java.util.concurrent.ExecutorService; import java.util.logging.Level; import java.util.logging.Logger; + +import com.hazelcast.replicatedmap.ReplicatedMapCantBeCreatedOnLiteMemberException; import jakarta.inject.Inject; import org.glassfish.api.event.EventListener; import org.glassfish.api.event.EventListener.Event; @@ -121,6 +124,7 @@ public void send(final Event event, boolean asynchronously) { public void run() { try { listener.event(event); + } catch(ReplicatedMapCantBeCreatedOnLiteMemberException e) { // Ignore } catch(Throwable e) { logger.log(Level.WARNING, KernelLoggerInfo.exceptionDispatchEvent, e); } @@ -133,6 +137,7 @@ public void run() { // when synchronous listener throws DeploymentException // we re-throw the exception to abort the deployment throw de; + } catch(ReplicatedMapCantBeCreatedOnLiteMemberException e) { // Ignore } catch (Throwable e) { logger.log(Level.WARNING, KernelLoggerInfo.exceptionDispatchEvent, e); } diff --git a/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/config/ClusteredConfig.java b/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/config/ClusteredConfig.java index fd752d548f2..d9d43f43952 100644 --- a/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/config/ClusteredConfig.java +++ b/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/config/ClusteredConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) 2020-2024 Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -153,9 +153,10 @@ public T getSharedConfiguration(String name, T localValue, Bi public void clearSharedConfiguration(String name) { HazelcastInstance hzInstance = hzCore.getInstance(); if (hzInstance != null) { // can be null during shutdown - String instance = instanceName(hzInstance.getCluster().getLocalMember()); + Member localMember = hzInstance.getCluster().getLocalMember(); + String instance = instanceName(localMember); String mapName = CONFIGURATION_PREFIX + name; - if (instance != null) { + if (instance != null && !localMember.isLiteMember()) { hzInstance.getReplicatedMap(mapName).remove(instance); } }