Repository navigation
Closed
Milestone
Description
ArcadeDB Version:
24.10.1 & 24.11.1
OS and JDK Version:
OpenJDK 17 (Ubuntu and MacOS)
Expected behavior
No error
Actual behavior
Couldn't disable close on interrupt
java.lang.reflect.InaccessibleObjectException: Unable to make field private sun.nio.ch.Interruptible java.nio.channels.spi.AbstractInterruptibleChannel.interruptor accessible: module java.base does not "opens java.nio.channels.spi" to unnamed module @1c72da34
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.arcadedb.engine.PaginatedComponentFile.doNotCloseOnInterrupt(PaginatedComponentFile.java:216)
at com.arcadedb.engine.PaginatedComponentFile.open(PaginatedComponentFile.java:208)
at com.arcadedb.engine.ComponentFile.<init>(ComponentFile.java:50)
at com.arcadedb.engine.PaginatedComponentFile.<init>(PaginatedComponentFile.java:49)
at com.arcadedb.engine.FileManager.getOrCreateFile(FileManager.java:188)
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:57)
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:47)
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:42)
at com.arcadedb.engine.Dictionary.<init>(Dictionary.java:61)
at com.arcadedb.schema.LocalSchema.create(LocalSchema.java:138)
at com.arcadedb.database.LocalDatabase.openInternal(LocalDatabase.java:1782)
at com.arcadedb.database.LocalDatabase.create(LocalDatabase.java:207)
at com.arcadedb.database.DatabaseFactory.create(DatabaseFactory.java:90)
at com.arcadedb.console.Console.executeCreateDatabase(Console.java:444)
at com.arcadedb.console.Console.execute(Console.java:257)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)
Steps to reproduce
Using the console:
CREATE DATABASE test
or just start the server.
Fix
Add --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED to the JAVA_OPTS environment variable to prevent this behavior. Maybe this option should be added to the console.sh and server.sh scripts.
Notably, this very option is already in the root pom.xml.
Activity
[-]Errors[/-][+]Errors due to inaccessible modules (reflections?)[/+]#1753 add opens module to all scripts
#1753 add opens module to all scripts (#1754)
robfrank commentedon Oct 14, 2024
@gramian I merged the fix. Any test is welcome :)
gramian commentedon Oct 14, 2024
@robfrank I tested
console.shandserver.shwith #1754 and the error is not there anymore, so works for me. Thank you!vic0824 commentedon Oct 24, 2024
If I build a custom run-time image with jlink, I still get a lot of instances of the exception, even after adding the --add-opens and --add-exports JVM args:
These are the options that I use:
and this is the Maven plugin jlink configuration:
At the very end of the start-up sequence, I also get this bonus exception:
lvca commentedon Oct 24, 2024
Did you add
vic0824 commentedon Oct 25, 2024
Yes, these are my JVM options (I have copied the --add-opens and --add-exports directives from the latest version of https://github.com/ArcadeData/arcadedb/blob/main/package/src/main/scripts/server.sh):
Just to clarify: in my project I use ArcadeDB in embedded mode, and I use jlink to create a custom run-time image of my project (with ArcadeDB modules as dependencies).
If now Java 17 is the default for arcadedb, maybe it would be possible to use
MethodHandles.Lookupas a replacement for the standard reflective access.chore(deps): bump jline.version from 4.0.9 to 4.0.10 [skip ci]
chore(deps): bump org.neo4j.driver:neo4j-java-driver from 6.1.0 to 6.…
ArcadeData#1753 add opens module to all scripts (ArcadeData#1754)
chore(deps): bump jline.version from 4.0.9 to 4.0.10 [skip ci]
chore(deps): bump org.neo4j.driver:neo4j-java-driver from 4.4.20 to 6…