I migrated my application from java 8 to java 10. But now I see the following exception when try to store something in a database
Caused by: javax.persisten
This is the root cause
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private jdk.internal.reflect.ConstructorAccessorImpl jdk.internal.reflect.DelegatingConstructorAccessorImpl.delegate accessible: module java.base does not "opens jdk.internal.reflect" to unnamed module @55283c54
Java 10 has concept of modules and first of all public
is not "that" public anymore and reflection is also not that powerful.
You could use JVM flag as suggested by @RobertHume but in fact you need to migrate to a newer Hibernate version that supports Java9/10 (if any).
Also check this link https://www.sitepoint.com/reflection-vs-encapsulation-in-the-java-module-system/#commandlineescapehatches for more details regarding suggested JVM flag