No need to continue the discussion, I found the reason. In C# the onload event is fired when the control is attached (rendered). however in Vaadin the layout is rendered in class constractor (buildMainLayout), so the Application is empty at that time.
BTW, is there any EASY way to render the screen only after the component is attached(added)?
You are probably calling getApplication() from the constructor of the component, before the component is actually attached to the application. It only becomes attached to the application when added to the main window or to a component attached to the main window.