Vaadin-CDI use in ear with skinny wars

We are porting our app from cdi-utls to the ‘official’ Vaadin CDI addon and I am having an issue getting CDI to work properly.

We have a ear structure with skinny wars built using Maven

All the libs reside in the lib directory and the war and ejb manifest also reflects this. The vaadin-cdi-1.0.0.alpah1.jar is there also.

My ui war has a empty bean.xml file within the WEB-INF and no web.xml or jboss-web.xml file (we used to have them, but I will migrate this once the UI ‘starts’).

My ui class looks like this …

public class MyUI extends UI {

@WebServlet(urlPatterns = "/*", initParams = { //
        @WebInitParam(name = VaadinSession.UI_PARAMETER, value = "com.bla.bla.ui.MyUI"), //
        @WebInitParam(name = Constants.PARAMETER_WIDGETSET, value = "com.bla.bla.ui.MyWidgetset"), //
        @WebInitParam(name = Constants.SERVLET_PARAMETER_UI_PROVIDER, value = "com.vaadin.cdi.CDIUIProvider") //
public static class UIApplicationServlet extends VaadinServlet {
    // NO-OP

private NavigatorContainer navigator;

private CookieManager cookieManager;

private MainView mainView;

private LocalizationService localizedText;

private SystemMessagesProviderImpl systemMessagesProvider;

EventService eventService;

UserService userService;

private LocaleSelection localeSelection;

/* Root layout */
CssLayout root = new CssLayout();

private void init() {

protected void init(final VaadinRequest request) {


    // Once everything is setup, we go ahead and localize

My issue is that none of my injection points get injected and I don't see my UI getting registered like mentionned in the example:

INFO 1 beans inheriting from UI discovered!
INFO Available Vaadin UIs for CDI deployment [exampleCDIUI]

I am using Vaadin 7.1.6 and I am deploying on JBoss 7.1 but it seems WildFly gives me the same behaviour

Any help would be appreciated ...
Thanks !

After a lot of fiddling, I finally got it to work, seems like Vaadin has classloading issue when used in a ear with skinny wars.
I had to use the packaging defined in the first post
to get the CDI detection of the UI working properly.
Then I had to use the solution
to enhance the classloader in order to detect my beans properly.
With those two pieces in place, things worked like planned.

I can’t see how vaadin-cdi placed inside EAR\lib is supposed to work. Sure, CDI portable extension should be discovered, but
is using
annotation that
should not
work when placed in EAR\lib as mandated by the Servlet 3 spec which states

11.3.1 Provision of Listener Classes

The Developer of the Web application provides listener classes implementing one or
more of the listener interfaces in the javax.servlet API. Each listener class must
have a public constructor taking no arguments.
The listener classes are packaged
into the WAR, either under the WEB-INF/classes archive entry, or inside a JAR in
the WEB-INF/lib directory.