killme2008 / killme2008/xmemcached

java.io.InvalidClassException: filter status: REJECTED with Java 17

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
764
Forks
271
PR merge metrics
No merged PRs in 30d

Description

Hi Team ,

We have using this jar within our project which was using Java 11 and recently we tried to migrate to Java 17.

While the whole build is successful , we observed that we are not able to get data from memcached and it fails with below exception

```
2023-12-01 14:10:39.008+0530 | POST | :PostmanRuntime/7.35.0:dx-prod:FAB-8b5fdf20-1508-4405-a64d-2100d7d5ffd9 | nioEventLoopGroup-3- | | ERROR | net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder | Caught IOException decoding 102 bytes of data
java.io.InvalidClassException: filter status: REJECTED
at java.base/java.io.ObjectInputStream.filterCheck(ObjectInputStream.java:1414)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2055)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1909)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2235)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:514)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:472)
at net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder.deserialize(BaseSerializingTranscoder.java:109)
at net.rubyeye.xmemcached.transcoders.SerializingTranscoder.decode0(SerializingTranscoder.java:97)
at net.rubyeye.xmemcached.transcoders.SerializingTranscoder.decode(SerializingTranscoder.java:89)
at net.rubyeye.xmemcached.XMemcachedClient.fetch0(XMemcachedClient.java:624)
at net.rubyeye.xmemcached.XMemcachedClient.get0(XMemcachedClient.java:1030)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:988)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:999)
at com.oracle.cx.communications.dx4c.fabric.utils.core.cache.CacheUtil.get(CacheUtil.java:240)
at com.oracle.cx.industries.framework.routing.utils.InteractionContextEnrichmentUtil.getValueFromCacheAsMap(InteractionContextEnrichmentUtil.java:75)
```

We are storing Java Map to memcached and the set operation doing that is giving true. And retrieval is failing with above error.

In case if the data stored is in String format , we see both set and get works as expected. We see issue only when we have non Primitive Object is being tried to be retirved.

Current version of memcached: 2.4.7 Tried with 2.4.8 and saw same issue.

Can you please provide with any pointers on what could be the reason and how I could resolve it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder.deserialize, line 109, then trace SerializingTranscoder.decode0 and the Java 17 ObjectInputStream filtering behavior. Reproduce retrieval of a serialized Map with Java 17 and compare it with Java 11. Done means identifying a confirmed compatibility cause and documenting or implementing a supported resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.