I have a Java class (Entity) with a set of named queries. When the Spring tries to inject the related bean, it is not finding one of the queries.
As example:
@NamedQueries({
@NamedQuery(name = "Query1", query = "..."),
@NamedQuery(name = "Query2", query = "..."),
@NamedQuery(name = "Query3", query = "..."),
@NamedQuery(name = "Query4", query = "..."),
@NamedQuery(name = "Query5", query = "...")
})
When Spring tries to inject the bean, I´m getting:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'myBean': Injection of resource methods failed;nested exception is
java.lang.IllegalArgumentException: Named query not found: Query3 at ...
I´m sure the queries are correct (all the unit tests for them are passing).
Does anybody know the root cause for it?