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

Old dashboards failing due to com.google.gson.JsonIOException #2262

Open
damithc opened this issue Jan 19, 2025 · 3 comments
Open

Old dashboards failing due to com.google.gson.JsonIOException #2262

damithc opened this issue Jan 19, 2025 · 3 comments

Comments

@damithc
Copy link
Collaborator

damithc commented Jan 19, 2025

Some of my dashboards that I forgot to disable after the semester ended started failing recently.
Example: https://github.com/nus-cs2103-AY2324S2/ip-dashboard/actions/runs/12720039351/job/35461148355

Error:

Exception in thread "main" com.google.gson.JsonIOException: Failed making field 'java.time.ZoneRegion#id' accessible; either change its visibility or write a custom TypeAdapter for its declaring type
	at com.google.gson.internal.reflect.ReflectionHelper.makeAccessible(ReflectionHelper.java:22)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:158)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:101)
	at com.google.gson.Gson.getAdapter(Gson.java:501)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:56)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:126)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:244)
	at com.google.gson.Gson.toJson(Gson.java:747)
	at com.google.gson.Gson.toJson(Gson.java:726)
	at com.google.gson.Gson.toJson(Gson.java:681)
	at com.google.gson.Gson.toJson(Gson.java:661)
	at reposense.util.FileUtil.writeJsonFile(FileUtil.java:117)
	at reposense.report.ReportGenerator.generateReposReport(ReportGenerator.java:142)
	at reposense.RepoSense.main(RepoSense.java:79)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.time.ZoneRegion.id accessible: module java.base does not "opens java.time" to unnamed module @6a463b3d
	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.google.gson.internal.reflect.ReflectionHelper.makeAccessible(ReflectionHelper.java:19)

It is unlikely due to a change from our side but may be caused by a change from a dependency that we use or a change in CI environment. Still, we need to investigate.

@gok99
Copy link
Contributor

gok99 commented Jan 19, 2025

The failure coincides with the switch to the ubuntu 24 runner which uses Java 17 by default, which we don't yet support. Superficially, this should be fixed by merging the latest updates from publish-RepoSense.

However, we should into why this occurs in Java 17, for when we decide on bumping support.

@damithc
Copy link
Collaborator Author

damithc commented Jan 20, 2025

Thanks for the investigation, @gok99
Glad to hear this will not affect new dashboards I'll set up later in the semester.
Yes, we should look into fixing this when we upgrade to Java 17.

@CYX22222003
Copy link

I also encountered this issue when I tried to launch the dashboard using java 17 last week. I think a quick way to fix this is to add --add-opens java.base/java.time=ALL-UNNAMED before -jar

Here are some resources I found when I was searching for a solution to this issue

@sikai00 sikai00 self-assigned this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants