Same class different class-loader

Hi guys,
How should I properly Cast AbstractWindow to Class which it represents.

MyCustomWindow customWindow =
    (MyCustomWindow) openWindow(
       ParamsMap.of("value",origin, "split", true));

And getting error

Caused by: java.lang.ClassCastException:
cannot be cast to

Can someone help how to avoid this error ?
I came accross same approach as I am doing in here: cuba/ at a5d7e58d0e883650c0fe2312fc7c9778e6f672ad · cuba-platform/cuba · GitHub
at changePasswordAtLogon()

Any help appriciated :slight_smile:
Or should I just stick with:

AbstractWindow customWindow =
((MyCustomWindow) customWindow).getInfo()
((MyCustomWindow) customWindow).getInfo2()
((MyCustomWindow) customWindow).getInfo3()


usually, this issue is reproduced when you use the hot-deploy feature. Did you use it manually via the CUBA.platform plugin for the Intellij IDEA? Or maybe CUBA Studio was run in this time?

If it’s true, please try to clean tomcat/conf/app/ directory.

Best regards,

1 Like