admin管理员组文章数量:1389762
Have recently migrated my application from java8 to java17 and my code uses pdxserialisation which is default one to be used for gemfire cache. Am getting java.lang.string.value inaccessible exception during serialisation only when using java17. Spring-geode-starter doesn't provide any latest version to fix this issue.
I tried to set --add-opens in env.ini file to open many java internal packages like java.util, java.math, java.time, sun.security which are needed for serialisation. But our concern is that we many thousands of applications and it will be become hard to manage by setting the --add-opens in env.ini file. Is there any alternate option available rather than using --add-opens in env.ini ? Even i tried to refactor the code but am just using
public class test extends PdxSerialization {
private String name;
private JsonWebKey jwk;
private localDateTime created;
//get and set methods of all fields
public void toData(Pdxwriter pdxwriter) {
pdxwriter.writeString("name",getName()).markidentityfield("name");
pdxwriter.writeString("created",getCreated()).markidentityfield("created");
pdxwriter.writeString("jwk",getJwk()).markidentityfield("jwk");
and it gives java.lang.string.value inaccessible exception
Have tried using module-info option, varHandle but none of the options worked. I used burningwave dependency which has worked but our concern is that burningwave is third party library and we are not sure if it uses any unsafe approach. And hence wanted to find proper solution even in terms of refactoring code
For code refactoring, i tried to replace String with byte[], charAt[], stringBuilder but none of them worked and giving inaccessible exceptions
版权声明:本文标题:what is the alternate option for --add-opens for opening java internal packages in runtime - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744592736a2614592.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论