ZhiQinIsZhen opened a new issue, #14259:
URL: https://github.com/apache/dubbo/issues/14259

   ### Pre-check
   
   - [X] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) 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
   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
   ```java
   @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 
   ```java
   @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
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to