[
https://issues.jboss.org/browse/DROOLS-3766?page=com.atlassian.jira.plugi...
]
Geoffrey De Smet commented on DROOLS-3766:
------------------------------------------
[~mfusco] This is probably caused by Drools generating code in the unnamed module, which
is bad.
It could use the drl's package (first line in the drl file) or just
"org.drools.core".
[JPMS] Calls coming from unnamed module
---------------------------------------
Key: DROOLS-3766
URL:
https://issues.jboss.org/browse/DROOLS-3766
Project: Drools
Issue Type: Enhancement
Components: core engine
Affects Versions: 7.19.0.Final
Reporter: Martin Kröning
Assignee: Mario Fusco
Priority: Major
When running Drools in the context of OptaPlanner on the modulepath
([
Reference|https://github.com/kiegroup/optaplanner/pull/492]), it is required to open up
the domain package to all modules.
Only opening up to `org.drools.core` does not work, because the calls come from an
unnamed module:
{code:bash}
Exception in thread "main" java.lang.IllegalAccessError: class
org.drools.base.io.github.mwkroening.optaplannermodulepathexample.domain.CloudProcess520162288$getComputer
(in unnamed module @0x4d68b571) cannot access class
io.github.mwkroening.optaplannermodulepathexample.domain.CloudProcess (in module
io.github.mwkroening.optaplannermodulepathexample) because module
io.github.mwkroening.optaplannermodulepathexample does not export
io.github.mwkroening.optaplannermodulepathexample.domain to unnamed module @0x4d68b571
at
org.drools.base.io.github.mwkroening.optaplannermodulepathexample.domain.CloudProcess520162288$getComputer.getValue(Unknown
Source)
at
org.drools.core@7.18.0.Final/org.drools.core.base.extractors.BaseObjectClassFieldReader.getHashCode(BaseObjectClassFieldReader.java:180)
at
org.drools.core@7.18.0.Final/org.drools.core.base.ClassFieldReader.getHashCode(ClassFieldReader.java:224)
at
org.drools.core@7.18.0.Final/org.drools.core.util.AbstractHashTable$FieldIndex.hashCodeOf(AbstractHashTable.java:344)
at
org.drools.core@7.18.0.Final/org.drools.core.util.AbstractHashTable$SingleIndex.hashCodeOf(AbstractHashTable.java:409)
at
org.drools.core@7.18.0.Final/org.drools.core.util.index.TupleIndexHashTable.getOrCreate(TupleIndexHashTable.java:392)
at
org.drools.core@7.18.0.Final/org.drools.core.util.index.TupleIndexHashTable.add(TupleIndexHashTable.java:358)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.PhreakAccumulateNode.doRightInserts(PhreakAccumulateNode.java:217)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:85)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:581)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:552)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:379)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:339)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:175)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:133)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:213)
at
org.drools.core@7.18.0.Final/org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:88)
at
org.drools.core@7.18.0.Final/org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
at
org.drools.core@7.18.0.Final/org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
at
org.drools.core@7.18.0.Final/org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1062)
at
org.drools.core@7.18.0.Final/org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1009)
at
org.drools.core@7.18.0.Final/org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1001)
at
org.drools.core@7.18.0.Final/org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1330)
at
org.drools.core@7.18.0.Final/org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1321)
at
org.drools.core@7.18.0.Final/org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1305)
at
org.optaplanner.core@7.18.0.Final/org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.calculateScore(DroolsScoreDirector.java:171)
at
org.optaplanner.core@7.18.0.Final/org.optaplanner.core.impl.solver.recaller.BestSolutionRecaller.solvingStarted(BestSolutionRecaller.java:69)
at
org.optaplanner.core@7.18.0.Final/org.optaplanner.core.impl.solver.AbstractSolver.solvingStarted(AbstractSolver.java:76)
at
org.optaplanner.core@7.18.0.Final/org.optaplanner.core.impl.solver.DefaultSolver.solvingStarted(DefaultSolver.java:210)
at
org.optaplanner.core@7.18.0.Final/org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:190)
at
io.github.mwkroening.optaplannermodulepathexample/io.github.mwkroening.optaplannermodulepathexample.App.main(App.java:22)
{code}
It would be great, if it would be possible to make these kinds of calls come from a named
module.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)