&quot'重新安排的邮政请求错误
我正在使用重新安装的库,在下行,我会得到“ java.lang.exceptioninitializererror”
由引起的错误“由: private java.lang.class(java.lang.classloader,java.lang.class)可访问:module java.base不“ opens java.lang”到未命名的模块 @36f6e879” token_body 是字母数字字符串。我不确定问题到底是什么。我的Java -version得出
"java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)"
代码:
String bearerToken = given(). with().
header("Content-Type", "application/x-www-form-urlencoded"). body(token_Body).
when(). post(baseURI). then(). extract().asString();
I'm using restassured library and at the below line i'm getting "java.lang.ExceptionInInitializerError"
error caused by "Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private java.lang.Class(java.lang.ClassLoader,java.lang.Class) accessible: module java.base does not "opens java.lang" to unnamed module @36f6e879"
The baseURI is a http link and token_Body
is alphanumeric string. I"m not sure what exactly is the issue. My java -version yields
"java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)"
Code:
String bearerToken = given(). with().
header("Content-Type", "application/x-www-form-urlencoded"). body(token_Body).
when(). post(baseURI). then(). extract().asString();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也面临着类似的问题,并且通过更新重新安排到4.5.1的依赖性解决了问题。
I have faced a similar issue, and I have solved it by updating the dependency of restassured to 4.5.1