-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
None
-
False
-
False
-
Undefined
-
---
-
---
-
optaplanner-core depends on kogito-drools (so drools-core-dynamic transitively) because it needs to work with scoreDRL being compiled at runtime.
In optaplanner-quarkus, we need to swap out dynamic for static but that alone is not enough:
</dependency> <dependency> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-core</artifactId> <exclusions> <exclusion> <groupId>org.kie.kogito</groupId> <artifactId>drools-core-dynamic</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.kie.kogito</groupId> <artifactId>drools-core-static</artifactId> </dependency> <dependency> <!-- PROBLEM I need to add this too to make it work --> <groupId>org.kie.kogito</groupId> <artifactId>kogito-ruleunits</artifactId> </dependency>
We shouldn't have to add kogito-ruleunits, especially as we don't use ruleunits.
But if we don't add it, we get this:
java.lang.ExceptionInInitializerError at org.drools.statics.StaticServiceRegistrySupplier.get(StaticServiceRegistrySupplier.java:27) at org.drools.statics.StaticServiceRegistrySupplier.get(StaticServiceRegistrySupplier.java:23) at org.kie.api.internal.utils.ServiceRegistry$Impl.getServiceRegistry(ServiceRegistry.java:88) at org.kie.api.internal.utils.ServiceRegistry$ServiceRegistryHolder.<clinit>(ServiceRegistry.java:47) at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:39) at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:349) at org.kie.api.KieServices$Factory.get(KieServices.java:356) at org.kie.api.KieServices.get(KieServices.java:340) at org.drools.modelcompiler.builder.KieBaseBuilder.createKieBaseFromModel(KieBaseBuilder.java:68) at org.drools.modelcompiler.builder.KieBaseBuilder.createKieBaseFromModel(KieBaseBuilder.java:60) at org.optaplanner.core.impl.score.stream.drools.DroolsConstraintSessionFactory.<init>(DroolsConstraintSessionFactory.java:70) at org.optaplanner.core.impl.score.stream.drools.DroolsConstraintFactory.buildSessionFactory(DroolsConstraintFactory.java:104) at org.optaplanner.core.impl.score.director.stream.ConstraintStreamScoreDirectorFactory.<init>(ConstraintStreamScoreDirectorFactory.java:77) at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildConstraintStreamScoreDirectorFactory(ScoreDirectorFactoryFactory.java:185) at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.decideMultipleScoreDirectorFactories(ScoreDirectorFactoryFactory.java:106) at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildScoreDirectorFactory(ScoreDirectorFactoryFactory.java:74) at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildScoreDirectorFactory(DefaultSolverFactory.java:115) at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:83) at org.optaplanner.quarkus.OptaPlannerProcessorXMLDefaultTest.solverConfigXml_default(OptaPlannerProcessorXMLDefaultTest.java:62) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:297) at io.quarkus.test.QuarkusUnitTest.interceptTestMethod(QuarkusUnitTest.java:265) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) ... Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.kie.kogito.rules.units.impl.DataSourceFactoryImpl at org.drools.statics.SimpleInstanceCreator.instance(SimpleInstanceCreator.java:34) at org.drools.statics.StaticServiceRegistry.wireServices(StaticServiceRegistry.java:60) at org.drools.statics.StaticServiceRegistry.<init>(StaticServiceRegistry.java:52) at org.drools.statics.StaticServiceRegistry.<clinit>(StaticServiceRegistry.java:45) ... 86 more Caused by: java.lang.ClassNotFoundException: org.kie.kogito.rules.units.impl.DataSourceFactoryImpl at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:412) at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:365) at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:412) at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:365) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at org.drools.statics.SimpleInstanceCreator.instance(SimpleInstanceCreator.java:32) ... 89 more
- is related to
-
KOGITO-3735 Split off kogito-drools-api to make drools a lightweight dependency
- Open