Anyone came across this error? I used JPA to call a stored procedure query.
java.lang.NoSuchMethodError: javax.persistence.EntityManager.createStoredProcedureQuery(Ljava/lang/String;)Ljavax/persistence/StoredProcedureQuery;
Anyone came across this error? I used JPA to call a stored procedure query.
java.lang.NoSuchMethodError: javax.persistence.EntityManager.createStoredProcedureQuery(Ljava/lang/String;)Ljavax/persistence/StoredProcedureQuery;
The method EntityManager.createStoredProcedureQuery(String procedureName)
is new in JPA version 2.1.
You are compiling your code against JPA 2.1, but you are running it in an environment that supports an older version of JPA.
Solution: Find out what version of JPA your environment supports, and use that when you compile your code; or update the environment that you use to run your application to a version that supports JPA 2.1.
This happens if you are using an interface that contains the method (createStoredProcedureQuery
), but the runtime instance of the object doesn't have the method, for example because it was compiled with the previous version of the interface.
In this specific case you seem to be using a JPA implementation that doesn't support methods added in Java EE 7. You might want to check if there is a newer version of the library available.