Migrating Infinispan local caches

83 views
Skip to first unread message

Alex Tran

unread,
Mar 24, 2025, 4:03:27 AM3/24/25
to WildFly
Hi all,

we make use some of Infinispan local caches in WildFly 11 for caching some of our application data. The caches use the default marshaller (JBoss) with a JDBC backend (persisting to a MariaDB database) .Everything works fine. When we start upgrading to WildFly 30, the documentation recommends to use Protostream marshaller instead. Unfortunately, it seems that when we change the marshalling protocol from Jboss to Protostream, the existing persisted cache entries can't be loaded with an error

17:19:29,687 ERROR [org.infinispan.interceptors.impl.InvocationContextInterceptor] (Unknown) ISPN000136: Error executing command PutKeyValueCommand on Cache 'savedTemplates', writing keys [org.wildfly.clustering.marshalling.spi.ByteBufferMarshalledKey [java.lang.String]]: org.infinispan.persistence.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'org.wildfly.clustering.marshalling.spi.ByteBufferMarshalledKey' on key: org.wildfly.clustering.marshalling.spi.ByteBufferMarshalledKey [java.lang.String] at org.infinispan....@14.0.20.Final//org.infinispan.persistence.jdbc.impl.table.AbstractTableManager.key2Str(AbstractTableManager.java:598)

I've tried to delete the corresponding database tables but still got the same error. Are there any ways to migrate the existing cache entries or completely clear them? Would be great if we can do that from CLI, e.g. jboss-cli.sh or something similar.

Thank you very much.
Alex

Paul Ferraro

unread,
Mar 24, 2025, 8:40:54 AM3/24/25
to Alex Tran, WildFly
Can you attach your the relevant configuration from you infinispan subsystem as well as a code snippet from your application where you create/access your cache?

Paul

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/18f247af-c227-4860-843e-7d0df7fecf52n%40googlegroups.com.

Alex Tran

unread,
Mar 24, 2025, 8:55:18 PM3/24/25
to WildFly
Hi Paul,

thanks for the promptly response. Attached you can find an excerpt of WildFly domain.xml (I've removed some internal names mostly, the configuration values remain).

In our Jakarta EE Web app, we use the cache as following

@Resource(mappedName = "java:jboss/infinispan/cache/myCacheContainer/myLocalCache")
private Cache<String, JavaPOJO> myLocalCache;

in which JavaPOJO is just a simple serializable Java class

public class JavaPOJO implements Serializable {
private static final long serialVersionUID = 1L;
...
}
and the usage is pretty straightforward, like

myLocalCache.put(cacheKey, cacheValue);


Let me know if you need further details.

Thanks
Alex
wildfly-caches.xml

Paul Ferraro

unread,
Mar 25, 2025, 11:50:50 AM3/25/25
to WildFly
I do not see anything in your attached XML that references ProtoStream.  Am I missing something?
ProtoStream would additionally require that the cache is able to load SerializationContextInitializer instances via ServiceLoader from the deployment classloader.
Additionally, your cache store is configured as a passivation store, but does not appear to define any container-wide passivation criteria.  I assume you define these per cache operation?
Or perhaps you only use the store to persist cache entries across restarts?

Paul

Alex Tran

unread,
Mar 25, 2025, 8:33:24 PM3/25/25
to Paul Ferraro, WildFly
Hi Paul,

sorry that I mixed up when copying and pasting, the cache container configuration is

<cache-container name="myCacheContainer" marshaller="PROTOSTREAM">

This is a legacy configuration we migrated from WildFly 11 to 30.

You are right thatthe caches are used for keeping the cache entries across restarts.

Thanks, Alex.

You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/-2-Bs53gvGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/e165189e-ada3-456d-876a-aa1f0898543fn%40googlegroups.com.

Paul Ferraro

unread,
Apr 1, 2025, 9:27:57 AM4/1/25
to WildFly
You'll want to use: marshaller="JBOSS"
Reply all
Reply to author
Forward
0 new messages