最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

what is the alternate option for --add-opens for opening java internal packages in runtime - Stack Overflow

programmeradmin0浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论