[jboss-jira] [JBoss JIRA] (DROOLS-1165) Syntax error on Java EE for 6.4.0.Final (6.3.0.Final worked fine)
Mario Fusco (JIRA)
issues at jboss.org
Thu May 5 05:01:00 EDT 2016
[ https://issues.jboss.org/browse/DROOLS-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-1165.
---------------------------------
Resolution: Rejected
This is a known issue caused by the fact that the version of Wildfly you're using depends on ecj 4.3.1. On Drools 6.4.0 we enabled full support for Java 8 but this requires ecj 4.4.2. Unfortunately the ecj version embedded in Wildfly overrides the one imported by Drools. Occasionally (as probably in your case) ecj 4.3.1 when configured to use Java 8 syntax fails even if the block of code it's trying to compile doesn't contain any Java 8 specific statement.
There are 2 workarounds for this:
# upgrading to a newer Wildfly version (better choice)
# in case you're not using any Java 8 feature you can force ecj to a specific Java compilation level (overriding the JVM one) by setting the System property "drools.dialect.java.compiler.lnglevel" to the desired language level, for instance "1.7".
> Syntax error on Java EE for 6.4.0.Final (6.3.0.Final worked fine)
> -----------------------------------------------------------------
>
> Key: DROOLS-1165
> URL: https://issues.jboss.org/browse/DROOLS-1165
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.4.0.Final
> Environment: Java EE 7, Wildfly
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Priority: Minor
> Attachments: 20160505.syntaxerroronjavaeefor640f.zip
>
>
> Hello, not sure if this is actually a Drools issue, or just some compiler error due to some other dependencies issue. Anyhow attached reproducer contains a DRL syntactically correct, parses correctly 6.4.0.Final when not on Java EE. When on Java EE instead, fails to parse lamenting syntax error, snippet:
> {code}
> [ function valueSizeGEofvalueSizeGEof (line:42): Syntax error, static imports are only available if source level is 1.5 or greater
> valueSizeGEof (line:42): The import java.util.stream.Collectors.groupingBy cannot be resolved
> valueSizeGEof (line:44): Syntax error, static imports are only available if source level is 1.5 or greater
> valueSizeGEof (line:44): The import com.acme.testaccumulatestreamonjavaee.MapOfList.mapOfList cannot be resolved
> valueSizeGEof (line:46): Syntax error, static imports are only available if source level is 1.5 or greater
> valueSizeGEof (line:46): The import com.acme.testaccumulatestreamonjavaee.EntryKey.entryKey cannot be resolved
> valueSizeGEof (line:52): Syntax error, parameterized types are only available if source level is 1.5 or greater
> valueSizeGEof (line:53): Type mismatch: cannot convert from Integer to int
> valueSizeGEof (line:54): Syntax error, parameterized types are only available if source level is 1.5 or greater
> valueSizeGEof (line:55): Syntax error, annotations are only available if source level is 1.5 or greater
> valueSizeGEof (line:56): Syntax error, parameterized types are only available if source level is 1.5 or greater
> ]
> {code}
> Please notice if using 6.3.0.Final, on Java EE, is OK without errors.
> For the reproducer, maven {{clean test}} using profile {{wildfy82-embedded}}. I am using Arquillian to demonstrate the difference using version 6.3.0.Final Vs 6.4.0.Final.
> Can you kindly advise, please?
> Thank you
> Ciao
> MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list