Can you try findFirstByUsernameOrderByUsername i think JPA expects something after by but then you continue with OrderBy