Entity class User is missing some of enhancing interfaces:

I generated my data model against postgresql using multi-db support. After which I got this run time error.
Caused by: javax.persistence.PersistenceException: io.jmix.eclipselink.impl.mapping.EntityNotEnhancedException: Entity class User is missing some of enhancing interfaces:PersistenceObject,PersistenceWeaved,PersistenceWeavedFetchGroups

package tools.dataintegration.metl.admin.entity;

import io.jmix.core.entity.annotation.JmixGeneratedValue;
import io.jmix.core.entity.annotation.SystemLevel;
import io.jmix.core.metamodel.annotation.DependsOnProperties;
import io.jmix.core.metamodel.annotation.InstanceName;
import io.jmix.core.metamodel.annotation.JmixEntity;
import io.jmix.security.authentication.JmixUserDetails;
import org.springframework.security.core.GrantedAuthority;

import javax.persistence.*;
import javax.validation.constraints.Email;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;

@JmixEntity
@Entity(name = “metladm_User”)
@Table(name = “METLADM_USER”, indexes = {
@Index(name = “IDX_METLADM_USER_ON_USERNAME”, columnList = “USERNAME”, unique = true)
})
public class User implements JmixUserDetails {

@Id
@Column(name = "ID")
@JmixGeneratedValue
private UUID id;

@Version
@Column(name = "VERSION", nullable = false)
private Integer version;

@Column(name = "USERNAME", nullable = false)
protected String username;

@SystemLevel
@Column(name = "PASSWORD")
protected String password;

@Column(name = "FIRST_NAME")
protected String firstName;

@Column(name = "LAST_NAME")
protected String lastName;

@Email
@Column(name = "EMAIL")
protected String email;

@Column(name = "ENABLED")
protected Boolean enabled = true;

@Transient
protected Collection<? extends GrantedAuthority> authorities;

public UUID getId() {
    return id;
}

public void setId(UUID id) {
    this.id = id;
}

public Integer getVersion() {
    return version;
}

public void setVersion(Integer version) {
    this.version = version;
}

public String getPassword() {
    return password;
}

@Override
public String getUsername() {
    return username;
}

public void setUsername(String username) {
    this.username = username;
}

public Boolean getEnabled() {
    return enabled;
}

public void setEnabled(Boolean enabled) {
    this.enabled = enabled;
}

public void setPassword(String password) {
    this.password = password;
}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public String getFirstName() {
    return firstName;
}

public void setFirstName(String firstName) {
    this.firstName = firstName;
}

public String getLastName() {
    return lastName;
}

public void setLastName(String lastName) {
    this.lastName = lastName;
}

@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
    return authorities != null ? authorities : Collections.emptyList();
}

@Override
public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
    this.authorities = authorities;
}

@Override
public boolean isAccountNonExpired() {
    return true;
}

@Override
public boolean isAccountNonLocked() {
    return true;
}

@Override
public boolean isCredentialsNonExpired() {
    return true;
}

@Override
public boolean isEnabled() {
    return enabled;
}

@InstanceName
@DependsOnProperties({"firstName", "lastName", "username"})
public String getDisplayName() {
    return String.format("%s %s [%s]", (firstName != null ? firstName : ""),
            (lastName != null ? lastName : ""), username).trim();
}

}

To recreate:
Create New project
Immediately change Data Store to something other then H2 (either the Main or added new)
Run/Build will fail with this runtime error on 1st web page view

My fix;
Create New project
Run/Build without changing any Data Store connections and validate webpage
Then change Data Store to something other then H2
Then it will work.

Additional note: I recreated the postgres schema at one point which may had helped.

Hi @fredzim1,

Could you provide a sample project that reproduces the error?
Most likely the error is described in the issue: https://github.com/Haulmont/jmix-gradle-plugin/issues/12
The error has fixed in the 1.0.0-SNAPSHOT version and will be included in 1.0.0.

I was facing same issue for jmix 2.1.0. And was using unsupported JDK 21.
Then I setup JDK 17 and works.