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

[Bug] 3.3.0-beta2 update to beta3, exception : module java.base does not "opens java.util" to unnamed module #14259

Closed
3 of 4 tasks
ZhiQinIsZhen opened this issue May 30, 2024 · 3 comments
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@ZhiQinIsZhen
Copy link

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

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

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.3.0-beta3, jdk 21, windows

Steps to reproduce this issue

java.io.IOException: org.apache.dubbo.common.serialize.SerializationException: java.lang.RuntimeException: Unable to make field private final java.lang.Object[] java.util.ImmutableCollections$ListN.elements accessible: module java.base does not "opens java.util" to unnamed module @60addb54
 field: xxx.service.auth.bo.AuthUserBO.authorities
 class: xxx.service.auth.bo.AuthUserBO

1.It has no this exception in dubbo 3.3.0-beta2 version
2.Upgrade to dubbo 3.3.0-beta3 version, has this exception. so i add --add-opens java.base/java.util=ALL-UNNAMED, has other exception
com.alibaba.com.caucho.hessian.io.HessianFieldException: xxx.service.auth.bo.AuthUserBO.authorities: null array

Here's my class(AuthUserBO) information

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthUserBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 6046110472442516409L;

    /**
     * 权限列表
     */
    private List<AuthGrantedAuthorityBO> authorities = new ArrayList<>();
}

3.i update AuthUserBO code to this

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthUserBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 6046110472442516409L;

    /**
     * 权限列表
     */
    private List<AuthGrantedAuthorityBO> authorities;
}

then use set method : authUserBO.setAuthorities (new ArrayList<>()), it has no exception.
Last i remove vm --add-opens java.base/java.util=ALL-UNNAMED, it alse has no exception.

What you expected to happen

no exception

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@ZhiQinIsZhen ZhiQinIsZhen added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels May 30, 2024
@aofall
Copy link
Contributor

aofall commented May 31, 2024

In 3.3.0-beta.2 the default serialization is fastjson2, in 3.3.0-beta.3 the hessian serialization back and set as default serialization by #13974

It caused by hessian serialization. You can temporarily set the serialization as fastjson2 again. The issue of hessian serialization with newly JDK may solved in the future.

You can modify the settings according to the actual situation, and be aware that there may be unexpected issues with fastjson2 as well.

dubbo:
  protocol:
    serialization: fastjson2
    prefer-serialization: fastjson2,hessian2

@wcy666103
Copy link
Contributor

wcy666103 commented Jun 5, 2024

We had a meeting to discuss this problem, the reason is that the adaptation of hessian2 with high jdk version is difficult, so we can use fastjson2 first

@AlbumenJ
Copy link
Member

Already fixed in apache/dubbo-hessian-lite#70

Please wait Hessian Lite 4.0.1 and Dubbo 3.3.0-beta.4 being released. BTW, in order to solve it, you need to upgrade both client and server side.

@github-project-automation github-project-automation bot moved this from Todo to Done in Dubbo Board Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Archived in project
Development

No branches or pull requests

4 participants