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

InaccessibleObjectException while executing tests with JDK17 #149

Open
nskshared opened this issue Jul 7, 2023 · 7 comments
Open

InaccessibleObjectException while executing tests with JDK17 #149

nskshared opened this issue Jul 7, 2023 · 7 comments

Comments

@nskshared
Copy link

hi
We are getting below error while running our tests against POJO classes. Looks like they increased security levels in jdk17 hence its difficult to change access modifiers etc.

Please can you advise if there is any alternative for below issue.

Unable to make field private static final long java.time.LocalDate.serialVersionUID accessible: module java.base does not "opens java.time" to unnamed module @6be46e8f
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.time.LocalDate.serialVersionUID accessible: module java.base does not "opens java.time" to unnamed module @6be46e8f

@flowerforest0123
Copy link

Same Problem with Map: Unable to make field private static final java.util.Map java.util.Locale.CONSTANT_LOCALES accessible: module java.base does not "opens java.util" to unnamed module @757942a1

@rahul-konduru
Copy link

I got the same issue for java.time.LocalDate.serialVersionUID. After looking at the stacktrace found out that openpojo is trying to generate a random value for LocalDateTime which was used in one of my class.
There are 2 possible solutions to get over this error.

@vmgbrown
Copy link

I tried the workaround suggested above but it didn't work for me.

This is a major issue, but it doesn't seem like this project has gotten much attention lately. Wondering if it will ever be addressed.

@rahul-konduru
Copy link

rahul-konduru commented Dec 21, 2023 via email

@vmgbrown
Copy link

@rahul-konduru Sorry I wasn't clear. I tried the --add-opens workaround. We use OpenPOJO in a lot of tests, so any sort of custom workaround is likely to be a non-starter.

My bigger issue is the lack of updates. If this project is not being maintained, we will most likely need to look into other options.

@rahul-konduru
Copy link

rahul-konduru commented Dec 21, 2023 via email

@vmgbrown
Copy link

@rahul-konduru The custom generator case is working for now. Thank you for the suggestion!

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

4 participants