I have a Java class (Entity) with a set of named queries. When Spring tries to insert a bound bean, it does not find one of the queries.
As an 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 introduce a bean, I get:
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 am sure that the queries are correct (all unit tests pass for them).
Does anyone know a reason for this?
source
share