Push can not get UI instance using Spring

Hi all,

I am trying to send a message from a Spring Service to a Vaadin View using “ru.xpoft.vaadin” plugin.

All my views and UI are working using prototype scope, but when I try to send a message from a service “singleton scope” to my view it gets null for the current UI.

Is there any reason for it? UI.getCurrent() returns null.

I’d appreciate any help.

For example:

class service{
public void send(){

@VaadinView(value = “myView”)
class MyView implements BroadcastListener{

public void init() {
public void receiveBroadcast(final String message) {
    UI.getCurrent().access(new Runnable() {
        public void run() {
            LOGGER.info(Thread.currentThread().getName() + ": " + message);

public void detach() {


This usually happens when the component (view) is not attached with UI. I don’t see a reason to make UI class prototype scope. Spring might be returning new UI every time due to scope and View is not attached to new UI.

Can you change the UI scope to some other wider scope like @scopeUI