I can't access the old user table

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)
        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.


Making debug deeper I found the error, the problem was related with a fetchplan that was direcly copied from the views with a property it looks doesn’t exist anymore, removing the property solve the problem. Now just throwing a exeption without more info for this kind of things doesn’t look a good practice, I lost a complete day for this, an this is the simple proyect we want to migrate, could you please add more explicit errors in the future?.

PD: The function that trhows this error is the init() on charge to load the fetchplans.

1 Like

Hi Antonio,

Could you give us more details on the exception and where the erroneous property was defined?

My quick test with adding inexistent property to fetch-plans.xml results in a decent exception:

Caused by: java.lang.IllegalArgumentException: Property 'abc' not found in User
	at io.jmix.core.metamodel.model.impl.MetaClassImpl.getProperty(MetaClassImpl.java:97) ~[jmix-core-1.2.2.jar:na]
	at io.jmix.core.impl.FetchPlanLoader.loadFetchPlanProperties(FetchPlanLoader.java:130) ~[jmix-core-1.2.2.jar:na]
	at io.jmix.core.impl.FetchPlanRepositoryImpl.deployFetchPlan(FetchPlanRepositoryImpl.java:459) ~[jmix-core-1.2.2.jar:na]
	at io.jmix.core.impl.FetchPlanRepositoryImpl.init(FetchPlanRepositoryImpl.java:118) ~[jmix-core-1.2.2.jar:na]

I think is systemProperties=“true”, like:

 <view entity="first" name="first-view" extends="_local" systemProperties="true">

Try with this one, because i have no acces now to the wrong part, if is not i will try to make you an example on my free time.

Nope, it’s just ignored.