This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

But now, when I run my application using mvn tomcat:run, I have an error for all my Roo entities like this one :

The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class<Driver>)

So, correct me if I'm wrong but it seems that adding the drools-spring dependency made my project using JPA1 instead of JPA2. But Roo 1.1.5 generates .aj files for JPA2...
Has anyone of you had already met this problem ?

Thanks in advance for your help.
Let me know if you need more information.

The problem is that drools-grid-impl depends on ejb3-persistence and persistence-api using JPA 1.0. But when I exclude drools-grid-impl, I have drools errors.
Why does my project uses JPA 1.0 whereas I have a javax.persistence-2.0.3 dependecy.

Comment

Modifying third-party JAR files (e.g. removing persistence.xml) is a last resort, as you then have to maintain and publish your own modified versions of those artifacts. A more sustainable/orthodox approach is to exclude the troublesome dependencies from your project. You've already tried excluding drools-grid-impl and that caused problems, so try excluding that JAR file's transitive JPA 1 dependencies. You can identify these using the following Maven command:

Code:

mvn dependency:tree

Look for the lines below drools-grid-impl to see what it's pulling in, then add exclusions to your project's drools-spring dependency to exclude the troublesome ones.

If that doesn't help, you're probably best off asking on a Drools (or Spring Drools) forum, as people there are more likely to have encountered this situation and have a solution.