IllegalStateException with naming parameters in tomcat
What fixed it is changing the '?' to :param and adding @Param("param") before the parameter in the method.
Meaning that the select method:
@Query(value = "SELECT * FROM agents limit ?1, ?2", nativeQuery = true)public List<AgentEntity> getAll(int start, int length);
has changed to
@Query(value = "SELECT * FROM agents limit :start, :length", nativeQuery = true)public List<AgentEntity> getAll(@Param("start") int start, @Param("length") int length);
That fixed the problem.
I can works in the following ways
With param@Query(value = "SELECT * FROM agents limit :start, :length", nativeQuery = true)public List getAll(@Param("start") int start, @Param("length") int length);
Without param@Query(value = "SELECT * FROM agents limit :start, :length", nativeQuery = true)public List getAll(int start,int length);