Liferay 7, Vaadin 8 and OSGI

Hi, we are using vaadin 8 with liferay 8 and osgi. We need start our vaadin UI through VaadinServlet.

We have …
@Theme(“valo”)
public class CustomUI extends UI {

@Override
protected void init(VaadinRequest request) {
    Label label = new Label("OK!!!!!!!");
    setContent(label);
}

@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = CustomUI.class, productionMode = false)
@Component(service = MyUIServlet.class)
public static class MyUIServlet extends VaadinServlet {

    @Override
    protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration)
    throws ServiceException {

        ServletService servletService2 = new ServletService(this, deploymentConfiguration);
        servletService2.init();
        return servletService2;
    }
}

}


public class ServletService extends VaadinServletService {

private static final long serialVersionUID = 1 L;

public ServletService(VaadinServlet servlet, DeploymentConfiguration deploymentConfiguration)
throws ServiceException {
    super(servlet, deploymentConfiguration);
}

@Override
public ClassLoader getClassLoader() {
    // return the bundle classloader
    // see http://dev.vaadin.com/ticket/15516
    return ServletService.class.getClassLoader();
}

}


@Component(
immediate = true,
property = {
“com.liferay.portlet.display-category=category.sample”,
“com.liferay.portlet.instanceable=true”,
“javax.portlet.name=MyVaadinPortlet”,
“javax.portlet.display-name=Vaadin OSGi Fragment Portlet”,
“javax.portlet.init-param.UI=com.example.plugins.CustomUI”,
“javax.portlet.security-role-ref=power-user,user”
},
service = javax.portlet.Portlet.class
)
public class Portlet extends VaadinPortlet {}

When the bundle is loaded we create our portlet in liferay but we get this message:

… java.lang.ClassNotFoundException: com.example.plugins.CustomUI

We let attached a screenshot with more details.

What we are missing? It’s a posible bug?

Thanks!

34713.png

We let attached the project
34715.zip (44.2 KB)