I am migrating the first app of my company to jmix from latest version of cuba, finally I get it running, even wherer is still a lot to do, but when I try to login I realize that is not taking the user admin from db, debuggin I discover that the querey return empty array so I get InternalAuthenticationServiceException.
I have to say that we had extend User and the login screen, however the error I am getting is that the user admid doesn’t exits and I can see in the raw database that this is not true.
May be a permissons error?
I am a little lost with this and the error log is not helping much, I would appreciate at least some orientation.
The problemes comes here in this method:
public T loadUserByUsername(String username) throws UsernameNotFoundException {
List<T> users = dataManager.load(getUserClass())
.query("where e.username = :username")
.parameter("username", username)
.list();
if (!users.isEmpty()) {
T user = users.get(0);
if (user instanceof AcceptsGrantedAuthorities) {
((AcceptsGrantedAuthorities) user).setAuthorities(createAuthorities(username));
}
return user;
} else {
throw new UsernameNotFoundException("User not found");
}
}
When datamanager is trying to get the user, I already check that username is correct here, and I have a user with this username in my db (postgresql), the class i get from getUserClass is just the deaful( the correct one actually), and I am not getting a related error because as yo see there is not errore asociated to de datamanager query in this case, so I am just getting a Exception with java.lang.NullPointerException, so I have nothing to continiu with, also since there is no passing this step there is no really user auth comparation.
Cheers.