findResource(“”) returning null when module-info.java is present, why is that?

One thing I notice is that your application (assuming that it’s packaged in tech.flexpoint.dashman) does not seem to be opened up to Spring in any way, which will surely result in failed class loading/illegal access. I would expect to see something like this in module-info.java (depending on your Spring dependencies): opens tech.flexpoint.dashman to spring.core, spring.beans, … Read more

Why project Jigsaw / JPMS?

Jigsaw and OSGi are trying to solve the same problem: how to allow coarser-grained modules to interact while shielding their internals. In Jigsaw’s case, the coarser-grained modules include Java classes, packages, and their dependencies. Here’s an example: Spring and Hibernate. Both have a dependency on a 3rd party JAR CGLIB, but they use different, incompatible … Read more

Why did Java 9 introduce the JMOD file format?

The purpose of JMODs are not well documented and existing documentation is rather sparse. Here is an in-depth explanation of system, from my understanding. Parts of this answer are rather long, verbose, partially redundant, and a tough read. Constructive, structural, or grammatical edits are more than welcome to improve readability for future readers. Short(er) Answer … Read more

What’s the difference between –add-exports and –add-opens in Java 9?

With –add-exports the package is exported, meaning all public types and members therein are accessible at compile and run time. With –add-opens the package is opened, meaning all types and members (not only public ones!) therein are accessible at run time. So the main difference at run time is that –add-opens allows “deep reflection”, meaning … Read more

How to solve InaccessibleObjectException (“Unable to make {member} accessible: module {A} does not ‘opens {package}’ to {B}”) on Java 9?

The exception is caused by the Java Platform Module System that was introduced in Java 9, particularly its implementation of strong encapsulation. It only allows access under certain conditions, the most prominent ones are: the type has to be public the owning package has to be exported The same limitations are true for reflection, which … Read more

What is an illegal reflective access?

Apart from an understanding of the accesses amongst modules and their respective packages. I believe the crux of it lies in the Module System#Relaxed-strong-encapsulation and I would just cherry-pick the relevant parts of it to try and answer the question. What defines an illegal reflective access and what circumstances trigger the warning? To aid in … Read more