We're seeing reports that Drools 6 does not work on Java 8:
Stacktraces look like this:
Caused by: java.lang.RuntimeException: wrong class format
Download Java 8 here:
Drools should work on JDK 6, 7 and 8 out of the box (without setting any special properties)
A) Upgrade ECJ from 3.7.2 to 4.3.1. This might fix it.
B) Change the default compiler from ECJ (=eclipse) to native. This might be slower.
Note: A) and B) are not mutually exclusive.
I upgraded the Eclipse Java Compiler to version 4.3.1 with the following commits:
Doing so the list of the failing tests in drools-compiler while running Java8 got reduced to the following 5:
KnowledgeBuilderTest.testDifferentPackages:157 Rule Compilation error : [Rule name='R1']
org/drools/compiler/test/rule/Rule_R12147099725.java (7:443) : list cannot be resolved
Tests in error:
TruthMaintenanceTest.testLogicalInsertionsWithExists:768 » IllegalArgument byt...
TruthMaintenanceTest.testLogicalInsertionsWithModify:495 » IllegalArgument byt...
TruthMaintenanceTest.testLogicalInsertionsUpdateEqual:703 » IllegalArgument by...
TruthMaintenanceTest.testLogicalInsertionsNot:611 » IllegalArgument byte strea...
Note that exactly the same tests also fail when running the native Java compiler.
I fixed the KnowledgeBuilderTest with these commits:
I think the TruthMaintenanceTest are not real failures but only test issues causes by the comparison of the byte created by 2 subsequent serializations. We already experienced a similar problem migrating from Java6 to Java7.
For now I ignored those serialization failures with this commit
Anyway the generated byte or of the same size, so very likely the test failures are only caused by a different iteration order.
I also updated the ASM version embedded in mvel, even if this is will be available only when I'll drop another release of mvel. Anyway this is not strictly necessary to make drools to run on Java 8 (even if it generates Java7 bytecode for now).
I am reassigning this ticket to Michael because, for what I know, at the moment there is an issue on drools-wb. This issue is mainly caused by the currently used version of GWT that doesn't provide Java8 support.
I ran kie-wb and kie-drools-wb on EAP6.3 with Java 8 and (other than the above referenced bug - which is now fixed) found the workbenches to work OK (I only did a quick test and examination of the logs).
One issue I did notice is this:
10:12:39,813 INFO [org.apache.sshd.common.util.SecurityUtils] (MSC service thread 1-9) BouncyCastle not registered, using the default JCE provider
10:12:42,081 INFO [org.guvnor.m2repo.backend.server.GuvnorM2Repository] (MSC service thread 1-9) Maven Repository root set to: repositories/kie
10:12:42,081 INFO [org.guvnor.m2repo.backend.server.GuvnorM2Repository] (MSC service thread 1-9) Creating Maven Repository root: repositories/kie
10:12:42,195 INFO [org.jbpm.console.ng.asset.backend.server.AssetMgmtDeploymentUnitProvider] (MSC service thread 1-9) Found guvnor asset management deployment unit org.guvnor:guvnor-asset-mgmt-project:6.3.0-SNAPSHOT [strategy=SINGLETON] attempting to deploy it
10:12:46,402 WARN [org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator] (MSC service thread 1-9) Process variable Data uses ObjectDataType for default type (java.lang) which could cause problems with setting variables, use dedicated type instead
10:12:46,636 WARN [org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator] (MSC service thread 1-9) Process variable Data uses ObjectDataType for default type (java.lang) which could cause problems with setting variables, use dedicated type instead
The ERROR is thrown when deploying the guvnor-asset-mgmt-project JAR to the jBPM runtime. I therefore assume (perhaps incorrectly) that there might be an issue with jBPM runtime and Java 8.
Re-assigning to a jBPM developer for consideration.
There seems to be a change in JS script engine between JDK7 and JDK8, and it's basically saying it can't find the JDK7 one on JDK8. I don't think this is something we can fix in our code base.
Since all work in our code base related to this is done, setting this one to MODIFIED.
Verified. I wrote a small JUnit test that used JDK8 and ran it with drools.dialect.java.compiler.lnglevel property set to 1.8.
Additional info: Drools and jBPM work on Java 8, but Java 8 syntax cannot be used in DRL rules. There is another Bugzilla ticket for this .
Mario Fusco <email@example.com> updated the status of jira DROOLS-329 to Resolved