Administration menu


I’m having a try on JMIX (currently using Cuba): I was surprised to see that, by default, the admin menu is almost empty. Reading the forum, I saw how to add the Entity Inspector, but I still don’t know how to display and use the Scheduled Tasks and the User Sessions Log that I find so useful.

Any advice on how to make these things enabled ?

Many thanks.


We made the decision to stop support for our scheduled tasks engine and use instead.

Use add-on as an alternative to User Sessions Log.

Full list of add-ons you can find here


Is there an example of using Quartz with Jmix available ?
Just a Hello world example, to see the creation of the Job would be enough.
The documentation is very light on this particular context.


Is there alternative add-on for CUBA Administration “Server Log” ?

OK I finally succeeded to set it up.

Any clues on how I can get the users’ session logs with this new jmix ?

Thanks in advance

Look at the authentication events. You can register login/logout events of your users, for example by defining an entity with a browse screen and creating such entities in the authentication event listeners.


1 Like

Thanks @krivopustov, this helps.
However, I have a last question: this doesn’t manage logout by time out, or logout by closing the browser window (as it was handled in CUBA). Is there a way to keep control on that and not keep ghost logins?
Have a nice day.

You can use the standard HttpSessionListener to catch when HTTP session is destroyed.

Below is a solution that creates a log record on user login and updates the record when the user logs out or the session expires.

The log item entity:

public class UserAuthenticationLog {
    @Column(name = "ID", nullable = false)
    private UUID id;

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

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

    @Column(name = "LOGGED_IN")
    private LocalDateTime loggedIn;

    @Column(name = "LOGGED_OUT")
    private LocalDateTime loggedOut;

    @Column(name = "SESSION_ID")
    private String sessionId;

    // getters and setters

The listener bean:

public class AuthenticationEventListener implements HttpSessionListener {

    private UnconstrainedDataManager dataManager;

    public void onInteractiveAuthenticationSuccess(InteractiveAuthenticationSuccessEvent event) {
        UserAuthenticationLog logItem = dataManager.create(UserAuthenticationLog.class);
        User user = (User) event.getAuthentication().getPrincipal();
        // Jmix provides session ID in ClientDetails class
        logItem.setSessionId(((ClientDetails) event.getAuthentication().getDetails()).getSessionId());;

    public void onLogoutSuccess(LogoutSuccessEvent event) {
        // we use session ID to find matching login record
        String sessionId = ((ClientDetails) event.getAuthentication().getDetails()).getSessionId();
        UserAuthenticationLog logItem = getLogOptional(sessionId)
                .orElseGet(() -> {
                    UserAuthenticationLog newLogItem = dataManager.create(UserAuthenticationLog.class);
                    User user = (User) event.getAuthentication().getPrincipal();
                    return newLogItem;

        if (logItem.getLoggedOut() == null) {

    public void sessionDestroyed(HttpSessionEvent se) {
        // we use session ID to find matching login record
                .ifPresent(logItem -> {
                    if (logItem.getLoggedOut() == null) {

    private Optional<UserAuthenticationLog> getLogOptional(String sessionId) {
        return dataManager.load(UserAuthenticationLog.class)
                .query("e.sessionId = ?1", sessionId)

To test the session expiration in UI, use the following property:

# 2 minutes 
jmix.ui.http-session-expiration-timeout-sec = 120


1 Like


I am trying the solution which you have provided. Most of the cases are working perfectly but sometimes i get the exception bellow:

java.lang.ClassCastException: class cannot be cast to class ( and are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @e2144e4)

Do you have any idea why I get this?

Thank you,

Hi Ilias,
Perhaps you can investigate the reason if if you check the real class of event.getAuthentication().getDetails() and log its content instead of getting sessionId.

Thank you for your reply.
I found out that when a user is logging in with remember me enabled (Not the first time while he had checked remember me but after closing the browser and open it again), event.getAuthentication().getDetails() is instance of WebAuthenticationDetails and not ClientDetails.
I made it work by retrieving sessionID from request.

1 Like