Using "user" Entity in another Entity throws exception

I have a Jmix composite project (Flow), when adding the User entity to another Entity as an attribute then it throws the following exception:

javassist.NotFoundException: io.jmix.security.authentication.JmixUserDetails

Note that, the user and where it is used are in the same add-on. If I remove user as attribute from that Entity, it works fine.

I have no problem using “user” Entity in another Entity logging in as admin to FlowUI 1.4.4 project.
Please provide more details.

1 Like

Hi
Did you try that in the composite FlowUI project?

Yes, I try it in composite FlowUI project but may be in a different way.

Add-on has no user entity. Did you mean subproject ?

Yes, in sub project, common for the whole composite project.

Hi Jmix team
Do you have any comments why I am getting this exception when I am using user as a field in a table in my project?

javassist.NotFoundException: io.jmix.security.authentication.JmixUserDetails

Here is the Entity file:

@JmixEntity
@Entity(name = "mdg_WorkflowLine")
public class WorkflowLine extends StandardTenantEntity {

    @Column(name = "STEP_NUMBER")
    private Integer stepNumber;

    @Column(name = "STEP_NAME")
    private String stepName;

    @Column(name = "LEAD_TIME_DAYS")
    private Integer leadTimeDays;

    @Column(name = "WF_ESCALATION_TYPE")
    private Integer wfEscalationType;

    @Column(name = "NOTIFICATION_ACTIVE")
    private Boolean notificationActive;

    @Column(name = "NOTIFICATION_SCHEDULE")
    private Integer notificationSchedule;

    @Column(name = "EMAIL_TEMP")
    private String emailTemp;

    @Column(name = "WORKFLOW_LINK_TYPE")
    private Integer workflowLinkType;

    @Column(name = "WORKFLOW_APPROVER")
    private Integer workflowApprover;

    @Column(name = "USER_NAME")
    private String userName;

    @JoinColumn(name = "USER_ID")
    @ManyToOne(fetch = FetchType.LAZY)
    private User user;

    @Column(name = "USER_ROLE")
    private String userRole;

    @Column(name = "WORKFLOW_COMMENT_OPTION")
    private Integer workflowCommentOption;

    @Column(name = "LIMIT_AMOUNT")
    private Double limitAmount;

    @OnDeleteInverse(DeletePolicy.CASCADE)
    @JoinColumn(name = "WORKFLOW_ID", nullable = false)
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Workflow workflow;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserRole() {
        return userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole;
    }

    public Workflow getWorkflow() {
        return workflow;
    }

    public void setWorkflow(Workflow workflow) {
        this.workflow = workflow;
    }

    public Double getLimitAmount() {
        return limitAmount;
    }

    public void setLimitAmount(Double limitAmount) {
        this.limitAmount = limitAmount;
    }

    public WorkflowCommentOption getWorkflowCommentOption() {
        return workflowCommentOption == null ? null : WorkflowCommentOption.fromId(workflowCommentOption);
    }

    public void setWorkflowCommentOption(WorkflowCommentOption workflowCommentOption) {
        this.workflowCommentOption = workflowCommentOption == null ? null : workflowCommentOption.getId();
    }


    public WorkflowApprover getWorkflowApprover() {
        return workflowApprover == null ? null : WorkflowApprover.fromId(workflowApprover);
    }

    public void setWorkflowApprover(WorkflowApprover workflowApprover) {
        this.workflowApprover = workflowApprover == null ? null : workflowApprover.getId();
    }

    public WorkflowLinkType getWorkflowLinkType() {
        return workflowLinkType == null ? null : WorkflowLinkType.fromId(workflowLinkType);
    }

    public void setWorkflowLinkType(WorkflowLinkType workflowLinkType) {
        this.workflowLinkType = workflowLinkType == null ? null : workflowLinkType.getId();
    }

    public String getEmailTemp() {
        return emailTemp;
    }

    public void setEmailTemp(String emailTemp) {
        this.emailTemp = emailTemp;
    }

    public NotificationSchedule getNotificationSchedule() {
        return notificationSchedule == null ? null : NotificationSchedule.fromId(notificationSchedule);
    }

    public void setNotificationSchedule(NotificationSchedule notificationSchedule) {
        this.notificationSchedule = notificationSchedule == null ? null : notificationSchedule.getId();
    }

    public Boolean getNotificationActive() {
        return notificationActive;
    }

    public void setNotificationActive(Boolean notificationActive) {
        this.notificationActive = notificationActive;
    }

    public WfEscalationType getWfEscalationType() {
        return wfEscalationType == null ? null : WfEscalationType.fromId(wfEscalationType);
    }

    public void setWfEscalationType(WfEscalationType wfEscalationType) {
        this.wfEscalationType = wfEscalationType == null ? null : wfEscalationType.getId();
    }

    public Integer getLeadTimeDays() {
        return leadTimeDays;
    }

    public void setLeadTimeDays(Integer leadTimeDays) {
        this.leadTimeDays = leadTimeDays;
    }

    public String getStepName() {
        return stepName;
    }

    public void setStepName(String stepName) {
        this.stepName = stepName;
    }

    public Integer getStepNumber() {
        return stepNumber;
    }

    public void setStepNumber(Integer stepNumber) {
        this.stepNumber = stepNumber;
    }
}

This is happening in a composite project where the above Entity is located in the same add-on where the security package is located.

regards
Mortoza