UI's init() method not called on VAADIN7 + OSGi

Hi all,

I am new to Vaadin and I try to make an application which will be deployed as an OSGi bundle.

I define my UI (which is an iPOJO component):

@Title("My First Vaadin App")
@Component(name="myApp")
@Instantiate
public class MainApplication extends UI {

    @Override
    public void init(VaadinRequest vaadinRequest) {
       ...
    }
}

and I register a servlet using HttpServie (injected by iPOJO):

final Dictionary<String, String> initParams = new Hashtable<String, String>();
        initParams.put("UI", "my.pack.MainApplication");
        initParams.put("UIProvider", "my.pack.MainApplicationProvider");
        initParams.put("widgetset", "my.pack.WidgetSet");

        Servlet mainServlet = new MainServlet();

        httpService.registerServlet("/app", mainServlet, initParams, null);

This UI is on a bundle which includes /VAADIN/ folder. I deploy the bundle and the required vaadin services on
Peergreen Server
. All bundles are well deployed, I tried to access to my app on
http://localhost:8080/app
and I got an empty page ! (However I got the right favicon and window title, it reassures me a little ^^).

After debugging, I saw that we never call the init() method of the UI. Any help?

Thanks in advance.

PS. I apologize for my broken English

Hi,

I read
this post
and I done the same thing but still not working. When I try to access to my servlet, nothing is displayed (normal, since init() method is not called). However, the title which I set with

@Title("My First Vaadin App") is well set on my window (my custom favicon too!).

Any help please? My brain hurts.

Hi, could you enable debug mode by appending
?debug
to the browser URL and copy-paste the contents of the debug window log? Or does the debug window appear at all? It seems that the bootstrap page is properly sent to the browser but for some reason it cannot load the actual UI. Is there an animated spinner on the page or is it completely blank? If you wait for long enough, do you get an alert dialog saying that the widgetset could not be loaded? Or you can use the network tab of your browser’s debug tools to see if any requests have failed. There may also be relevant information in the browser’s log.