[jboss-jira] [JBoss JIRA] (DROOLS-1169) Running drools with OpenJDK9 (10 May 2016) gives "type java.lang.Object cannot be resolved" and "java.io.Serializable cannot be resolved" due to ECJ 2.5
Geoffrey De Smet (JIRA)
issues at jboss.org
Thu Apr 6 11:19:00 EDT 2017
[ https://issues.jboss.org/browse/DROOLS-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13390329#comment-13390329 ]
Geoffrey De Smet commented on DROOLS-1169:
------------------------------------------
ECJ 4.6.1 is out, we should try it out to see if it fixes this issue.
> Running drools with OpenJDK9 (10 May 2016) gives "type java.lang.Object cannot be resolved" and "java.io.Serializable cannot be resolved" due to ECJ 2.5
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-1169
> URL: https://issues.jboss.org/browse/DROOLS-1169
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
> Labels: java9
>
> The code below runs perfectly with OpenJDK 8 (and even 6 and 7).
> To reproduce, use JDK 9 ( https://jdk9.java.net/download/ ) and in optaplanner-core, run XStreamXmlSolverFactoryTest [1] (or mostly any other test that builds a DRL file) to get this error:
> {code}
> 15:56:40.229 [main] ERROR o.d.c.k.b.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase
> Rule Compilation error : [Rule name='Conflict']
> org/optaplanner/core/api/solver/Rule_Conflict903142795.java (1:0) : The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
> org/optaplanner/core/api/solver/Rule_Conflict903142795.java (1:0) : The type java.io.Serializable cannot be resolved. It is indirectly referenced from required .class files
> org/optaplanner/core/api/solver/Rule_Conflict903142795.java (3:337) : Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
> org/optaplanner/core/api/solver/Rule_Conflict903142795.java (6:569) : java.lang.Exception cannot be resolved to a type
> java.lang.IllegalStateException: There are errors in a score DRL:
> Error Messages:
> Message [id=1, level=ERROR, path=org/optaplanner/core/api/solver/testdataScoreRules.drl, line=31, column=0
> text=Rule Compilation error The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
> The type java.io.Serializable cannot be resolved. It is indirectly referenced from required .class files
> Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
> java.lang.Exception cannot be resolved to a type]
> {code}
> That tests builds this DRL:
> {code}
> package org.optaplanner.core.api.solver;
> dialect "java"
> import org.optaplanner.core.api.score.buildin.simple.SimpleScoreHolder;
> import org.optaplanner.core.impl.testdata.domain.TestdataValue;
> import org.optaplanner.core.impl.testdata.domain.TestdataEntity;
> global SimpleScoreHolder scoreHolder;
> // ############################################################################
> // Constraints
> // ############################################################################
> rule "Conflict"
> when
> TestdataEntity(value != null, $leftValue : value)
> TestdataEntity(value == $leftValue)
> then
> scoreHolder.addConstraintMatch(kcontext, -1);
> end
> {code}
> Not sure where the Object constructor reference comes from... This might be a JDK 9 upstream issue.
> Note: don't build drools with OpenJDK9 as that will fail sooner :)
> [1] https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-core/src/test/java/org/optaplanner/core/impl/solver/XStreamXmlSolverFactoryTest.java
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list