Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsupportedOperationException: Class class java.util.LinkedHashMap$Entry doesn't support serialization #1855

Open
1 of 2 tasks
DemonJun opened this issue Sep 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DemonJun
Copy link

DemonJun commented Sep 26, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

0.7.1

Component(s)

Java

Minimal reproduce step

 List<Class<?>> NEED_REGISTER_CLASS = List.of(JSONObject.class, JSONArray.class);
    Fury fury =
        Fury.builder()
            .withLanguage(Language.JAVA)
            .withClassLoader(Thread.currentThread().getClass().getClassLoader())
            .withRefTracking(false)
            .withNumberCompressed(true)
            .withLongCompressed(true)
            .withStringCompressed(true)
            .registerGuavaTypes(true)
            // 关闭类型注册
            .requireClassRegistration(false)
            // 开启异步编译,提高第一次序列化效率
            .withAsyncCompilation(true)
            .build();
    AllowListChecker classChecker = new AllowListChecker();
    for (Class<?> aclass : NEED_REGISTER_CLASS) {
      fury.register(aclass);
    }

    // 因为关闭了 类型注册检查,这里额外添加一些,运行序列化的类前缀路径,尽量为了安全
    classChecker.allowClass("sun.util.calendar.ZoneInfo");

    fury.getClassResolver().setClassChecker(classChecker);

    JSONObject data = JSONObject.of();
    data.put("a",1);

    JSONObject copy = fury.copy(data);
    System.out.println(copy);

What did you expect to see?

可以正常序列化 map 类型

What did you see instead?

downgrade to 0.7.0

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@DemonJun DemonJun added the bug Something isn't working label Sep 26, 2024
chaokunyang pushed a commit that referenced this issue Oct 26, 2024
## What does this PR do?
fix child container bug


<!-- Describe the purpose of this PR. -->

## Related issues
#1855
<!--
Is there any related issue? Please attach here.

- #xxxx0
- #xxxx1
- #xxxx2
-->

## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant