[rules-users] Problem with Drools 6.0.1 Eclipse Projects with CDI and Java 7

Borris borris at chaos.org.uk
Thu Jul 24 11:10:08 EDT 2014


I had a similar problem.

There was a bug https://issues.jboss.org/browse/DROOLS-472 which has now 
been fixed. I think if you try the 6.1CR you should find the issue is 
resolved.

Borris

On Thursday 24/07/2014 15:35, WebHomer wrote:
> I'm new to Drools and pretty new to maven. I am trying to incorporate Drools
> 6.0.1 into a Wildfly (8.0.0) based project. I am using the current version
> of JBoss Developer Studio 7.1.1.GA on Redhat Linux In Eclipse the project
> has a number of errors in CDI modules, but builds without errors in maven.
> The Java auto-complete works correctly as I import annotations, but after is
> is imported I get an error in the file showing
>
> import javax.enterprise.context.ApplicationScoped;
> import javax.enterprise.context.Dependent;
> import javax.enterprise.inject.Disposes;
> import javax.enterprise.inject.Produces;
> import javax.enterprise.inject.spi.InjectionPoint;
> The above all show the same type of error:
>
> Only a type can be imported. javax.enterprise.inject.Disposes resolves to a
> package
> It seems to be limited to the javax cdi includes
>
> This is a maven project, and maven compiles it with no problems. Only
> Eclipse seems to have an issue.
>
> I have m2eclipse installed as well.
>
> In addition, if I use Java 7 syntax extensions it complains about those too.
> The maven pom specifies Java 1.7, the project facets specifies 1.7 and the
> default compliance level is also Java 1.7. But something somewhere doesn't
> like it. Again, a maven build works. Only Eclipse has problems. I suspect
> the Eclipse Drools plugin may be at fault as I don't see this in non-Drools
> projects
>
> I see this in the standard Java files, not the .drl files. It is quite
> annoying and frustrating. We have to build using only maven
>
> I found that this can be easily reproduced. You need m2eclipse installed,
> and the drools 6.0.1.Final eclipse plugin installed
> 1. In Eclipse create a new drools project
> 2. Convert the project to maven
> 3. add the javax.enterprise:cdi-api (version 1.1) dependency
> 4. Maven>Update Project
> 5. edit a java file in the project and try to add one of the above listed
> imports and you will see the same error.
>
> I believe that this is also related:
> I set my pom.xml to java 7, verified that the project was java 7 compliance
> etc and the eclipse editor still complained about the use of Java 7 features
> like the "diamond" operator.
> It seems that Drools doesn't like Eclipse and Java 7...
> <http://drools.46999.n3.nabble.com/file/n4030485/EclipseErrors.png>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Problem-with-Drools-6-0-1-Eclipse-Projects-with-CDI-and-Java-7-tp4030485.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list