Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot access class org.springframework.cglib.core.ReflectUtils with java 17 ! How to open a package of unknown module?

I want to integrate spring(spring boot 2.7.3) with JavaFx application implement on java17 and I got the following issue ;

class com.XXX$$EnhancerBySpringCGLIB$$637d19c4 (in module com.xxx) cannot access class 
org.springframework.cglib.core.ReflectUtils (in unnamed module @0x2d950574) because module
com.xxx does not read unnamed module @0x2d950574

Any Help ?

like image 586
Aguid Avatar asked Jan 21 '26 20:01

Aguid


2 Answers

I had a similar problem with Java 17 and solved it by adding to my open module in modules-info.java, the following:

    requires spring.core;
    requires spring.beans;

Using Spring Framework 6, Spring Boot 3.

like image 52
André Jakobsson Avatar answered Jan 23 '26 11:01

André Jakobsson


Try adding the JVM argument --add-reads=com.xxx=ALL-UNNAMED

like image 24
Thiago Henrique Hupner Avatar answered Jan 23 '26 11:01

Thiago Henrique Hupner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!