Call Remote EJB from Vaadin

Im working on a project involving a service layer implemented as EJB 3.1 application and Vaadin for UI.
The problem that im facing is related to calling Remote EJBs methods from Vaadin application. Im using the following code to call the service:

Context ejbCtx = new InitialContext(); RemoteService remoteEjb = (RemoteService) ejbCtx.lookup("java:global/project_name/RemoteInterfaceName");; When i call the EJB service from inside a Component class it gives me a NameNotFound exception however if i use the exact same code inside the Vaadin UI instance the EJB call succeeds. Does anyone know why calling an EJB service inside a Component instance ends up with an exception? and what are the best practices on integrating EJBs inside a Vaadin project?