Duplicate annotation error - but where?

I would be incredible surprised if the @NamedQueries is a issue, the name suggests that it should be a list/array of @NamedQuery items.

Try:

@Column(name = "name", length = 128)
private String name;

Seeing as you are confidant that you don't actually have @size repeated, maybe we should be looking at overlap of function, the @Column annotation contains the same functionality, maybe this could be causing a conflict.


I get the same issue but my problem was comming from pom.xml file. I had there two jpa dependencies

<dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
        <version>2.5.2</version>
        <scope>provided</scope>
</dependency>

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

I deleted the first one and this solved my problem. Sorry for my english level


The answers in here already discuss the possible solutions to solve this problem so I will focus on sharing my findings on the root cause of the issue.

I experienced this issue after generating entities using Netbeans 8.2 with the Create Persistence Unit box ticked. Doing this procedure causes two dependencies to be added to your project in the pom.xml namely org.eclipse.persistence.jpa.modelgen.processor and eclipselink.

These EclipseLink dependencies added to my project had a bug issue that was reported :

... @Column annotation seem to suddenly not be compatible with other annotations anymore.

As a result of this bug, you therefore would not be able to use @Column annotation with either @NotNull or @Size.