I began using Eclipse Mars and…

Today I downloaded and started using the latest version of Eclipse, called Mars. I began with a copy of a project I’m currently working on, a Java Web application that uses, among the other things, Java Persistence API (JPA) and Hibernate.

The first things I saw after importing the project into the workspace was this:

jpa1

On any class annotated with @Entity that used a @GeneratedValue on its primary key field. Not a good start…

The reported error was:

No generator named “increment” is defined in the persistence unit.jpa2

…even if the generator is defined right there with the @GenericGenerator annotation.

I searched the Internet for a couple of minutes without success, than the illumination: it’s a validation error. In fact, it does not prevent building the project, nor running it.

This is what you need to do to make the error go away and live easily again: open Windows -> Preferences and filter by “validation”; in the list, search for “JPA”, and uncheck the relative checkboxes. The annoying validation stops being performed.

jpa3

Besides, I’m not even sure that it is an actual error. Eclipse Luna does not report it; Maven, Hibernate, Jetty or Tomcat do not complain about it in any way. Is it a bug of Eclipse Mars? Well, probably I’m not going to research any further on this subject…