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

Illegal reflective access operation with Java 11 #61

Open
Kobee1203 opened this issue Apr 26, 2023 · 1 comment
Open

Illegal reflective access operation with Java 11 #61

Kobee1203 opened this issue Apr 26, 2023 · 1 comment

Comments

@Kobee1203
Copy link

Kobee1203 commented Apr 26, 2023

I run the tests of my project with Java 11, and I have the following warnings:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jparams.object.builder.provider.ObjectProvider (file:/C:/Users/.../.m2/repository/com/jparams/object-builder/2.3.1/object-builder-2.3.1.jar) to constructor java.lang.Class(java.lang.ClassLoader,java.lang.Class)
WARNING: Please consider reporting this to the maintainers of com.jparams.object.builder.provider.ObjectProvider
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Could you fix this problem to remain compatible with Java 11 and above?

@JiangHongTiao
Copy link

JiangHongTiao commented Oct 14, 2023

I'm experiencing this problem. I'm trying to migrate into Java 17, however my tests are failing:

java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.lang.Object java.lang.Throwable.backtrace accessible: module java.base does not "opens java.lang" to unnamed module @55fe41ea
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at com.jparams.verifier.tostring.FieldsProvider.provide(FieldsProvider.java:36)
	at com.jparams.verifier.tostring.ToStringVerifier.verify(ToStringVerifier.java:438)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:662)
	at com.jparams.verifier.tostring.ToStringVerifier.verify(ToStringVerifier.java:399)
	at church.i18n.processing.ToStringTest.testProcessingExceptionToString(ToStringTest.java:56)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Do you consider to update the library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants