diff --git a/changelog.html b/changelog.html
index b17ca91..fd186ff 100644
--- a/changelog.html
+++ b/changelog.html
@@ -41,6 +41,12 @@
HTTP File Upload Plugin Changelog
+1.5.0 -- (tbd)
+
+ - Now requires Openfire 4.8.1 or later
+ - Issue #43: ClassCastExceptions after reloading plugin in a cluster.
+
+
1.4.2 -- (November 19, 2024)
- Updated Chinese (zh_CN) translation
diff --git a/plugin.xml b/plugin.xml
index 8ecabfc..6145126 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -6,7 +6,7 @@
Guus der Kinderen
${project.version}
2024-11-19
- 4.7.0
+ 4.8.1
5.0.0
1.8
true
diff --git a/pom.xml b/pom.xml
index c736db2..b274bce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,13 +4,13 @@
plugins
org.igniterealtime.openfire
- 4.7.0
+ 4.8.1
org.igniterealtime.openfire.plugins
httpfileupload
HTTP File Upload Plugin
Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.
- 1.4.3-SNAPSHOT
+ 1.5.0-SNAPSHOT
diff --git a/src/java/org/igniterealtime/openfire/plugins/httpfileupload/OpenfireSlotProvider.java b/src/java/org/igniterealtime/openfire/plugins/httpfileupload/OpenfireSlotProvider.java
index dff935b..abbb767 100644
--- a/src/java/org/igniterealtime/openfire/plugins/httpfileupload/OpenfireSlotProvider.java
+++ b/src/java/org/igniterealtime/openfire/plugins/httpfileupload/OpenfireSlotProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2022 Ignite Realtime Foundation. All rights reserved.
+ * Copyright (c) 2017-2024 Ignite Realtime Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,10 +29,11 @@
public class OpenfireSlotProvider implements SlotProvider
{
- private final Cache slotsCache;
+ // Use string-representation of SecureUniqueId as cache key, as the interface cannot be processed by JAXB.
+ private final Cache slotsCache;
public OpenfireSlotProvider() {
- slotsCache = CacheFactory.createCache("HTTP File Upload Slots");
+ slotsCache = CacheFactory.createSerializingCache("HTTP File Upload Slots", String.class, Slot.class);
// Unless there is specific configuration for this cache, default the max lifetime of entries in this cache to something that's fairly short.
if (null == JiveGlobals.getProperty("cache." + slotsCache.getName().replaceAll(" ", "") + ".maxLifetime")) {
@@ -43,10 +44,10 @@ public OpenfireSlotProvider() {
@Override
public void create(@Nonnull final Slot slot)
{
- final Lock lock = slotsCache.getLock(slot.getUuid());
+ final Lock lock = slotsCache.getLock(slot.getUuid().toString());
lock.lock();
try {
- slotsCache.put( slot.getUuid(), slot );
+ slotsCache.put( slot.getUuid().toString(), slot );
} finally {
lock.unlock();
}
@@ -56,10 +57,10 @@ public void create(@Nonnull final Slot slot)
@Override
public Slot consume(@Nonnull final SecureUniqueId slotId)
{
- final Lock lock = slotsCache.getLock(slotId);
+ final Lock lock = slotsCache.getLock(slotId.toString());
lock.lock();
try {
- return slotsCache.remove(slotId);
+ return slotsCache.remove(slotId.toString());
} finally {
lock.unlock();
}