Guice 4.2 relies on cglib library, which makes an illegal reflection access to java.lang module. If we try to run Guice-based application with Gradle and Chainsaw, we get an error from JVM that java.base does not open java.lang to com.google.guice.
It seems that there is no good solution for that at the Guice side, until Guice fully migrates to Jigsaw and cglib is fixed. To deal with it, we must add the following CLI flag: --add-opens=java.base/java.lang=com.google.guice. Currently, there is no way to configure such custom flags via Chainsaw.
Guice 4.2 relies on cglib library, which makes an illegal reflection access to
java.lang
module. If we try to run Guice-based application with Gradle and Chainsaw, we get an error from JVM thatjava.base
does not openjava.lang
tocom.google.guice
.It seems that there is no good solution for that at the Guice side, until Guice fully migrates to Jigsaw and cglib is fixed. To deal with it, we must add the following CLI flag:
--add-opens=java.base/java.lang=com.google.guice
. Currently, there is no way to configure such custom flags via Chainsaw.