-
Type:
Bug
-
Resolution: Not an Issue
-
Priority:
P4
-
None
-
Affects Version/s: 25
-
Component/s: core-libs
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Tested on Windows x64, Windows ARM, and Linux x64
A DESCRIPTION OF THE PROBLEM :
In my open-source project I make massive use of the Java Platform Module System (JPMS) and ServiceLoader and declare my services in module-info.java.
In order to make use of ScopedValue I had to upgrade to Java 25.
However, this breaks all my tests with errors like this:
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Required at least 1 service(s) for java.util.ServiceLoader[io.github.mmm.bean.BeanFactory] [in thread "main"]
at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:126)
at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:108)
at io.github.mmm.bean.impl.BeanFactoryManager.<init>(BeanFactoryManager.java:30)
at io.github.mmm.bean.impl.BeanFactoryManager.<clinit>(BeanFactoryManager.java:21)
at io.github.mmm.bean.BeanFactory.get(BeanFactory.java:54)
at io.github.mmm.orm.statement.City.of(City.java:30)
at io.github.mmm.orm.mapping.OrmTest.testMapCity(OrmTest.java:43)
... 3 more
Even if I add "require" statements for all modules otherwise required indirectly (via "requires transitive"), the error remains. IMHO the ServiceLoader was broken in Java25 in combination with JPMS and there is no regression test for it in the JDK.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
mvn clean install
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Build success
ACTUAL -
Build failed
---------- BEGIN SOURCE ----------
See the attachment
---------- END SOURCE ----------
Tested on Windows x64, Windows ARM, and Linux x64
A DESCRIPTION OF THE PROBLEM :
In my open-source project I make massive use of the Java Platform Module System (JPMS) and ServiceLoader and declare my services in module-info.java.
In order to make use of ScopedValue I had to upgrade to Java 25.
However, this breaks all my tests with errors like this:
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Required at least 1 service(s) for java.util.ServiceLoader[io.github.mmm.bean.BeanFactory] [in thread "main"]
at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:126)
at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:108)
at io.github.mmm.bean.impl.BeanFactoryManager.<init>(BeanFactoryManager.java:30)
at io.github.mmm.bean.impl.BeanFactoryManager.<clinit>(BeanFactoryManager.java:21)
at io.github.mmm.bean.BeanFactory.get(BeanFactory.java:54)
at io.github.mmm.orm.statement.City.of(City.java:30)
at io.github.mmm.orm.mapping.OrmTest.testMapCity(OrmTest.java:43)
... 3 more
Even if I add "require" statements for all modules otherwise required indirectly (via "requires transitive"), the error remains. IMHO the ServiceLoader was broken in Java25 in combination with JPMS and there is no regression test for it in the JDK.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
mvn clean install
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Build success
ACTUAL -
Build failed
---------- BEGIN SOURCE ----------
See the attachment
---------- END SOURCE ----------