VAADIN 8 - Integrating @SpringUI without applicationContext.xml and Context

I’ve moved to xml config to JavaConfig. Now my vaadin UI is not working. Is it possible to configure vaadin without applicationcontext.xml?
Here is my configuration code -

public class MvcWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

  // Load database and spring security configuration
  public void onStartup(ServletContext servletContext) throws ServletException {
    // TODO Auto-generated method stub

  protected Class<?>[] getRootConfigClasses() {
    return new Class[] {WebSecurityConfig.class, HibernateConfiguration.class};

  // Load spring web configuration
  protected Class<?>[] getServletConfigClasses() {
    return new Class[] {WebMvcConfig.class};

  protected String[] getServletMappings() {
    return new String[] {"/"};

  protected Filter[] getServletFilters() {
    CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
    return new Filter[] {characterEncodingFilter, new DelegatingFilterProxy("springSecurityFilterChain")};

  protected void registerContextLoaderListener(ServletContext arg0) {
    arg0.setInitParameter("webAppRootKey", "shopbeat.root");


Below is my vaadin starter servlet -

@JavaScript({"", "vaadin://../assets/js/jquery.mp3.js", "vaadin://../assets/js/admin.js"})
@StyleSheet({"vaadin://../assets/css/player.css", "vaadin://../assets/css/custom.css"})
public class SkyAdminApplication extends UI implements Broadcaster.BroadcastListener {

  private static final long serialVersionUID = -8851261841287750333L;
  public static final long TIME_EDGE = 259200L;
  // The main application window. All components are embedded in this object.
  private SkyAdminApplication instance;
  private static Logger log = Logger.getLogger(SkyAdminApplication.class);
  private boolean stop = false;
  // The context - store all data related to logged in user here
  private Context context = null;

  public static class MyConfiguration {

  static {
    Thread.setDefaultUncaughtExceptionHandler(new SkyAdminUncaughtExceptionHandler());

  protected void init(VaadinRequest request) {
    // Close the application if the main window is closed.
    context = new Context();
    UI.getCurrent().addWindow(new LoginWindow(this));
    instance = this;

  // @return the current application instance
  public SkyAdminApplication getInstance() {
    return instance;

  public Context getSkyAdminContext() {
    return context;

  @WebServlet(urlPatterns = {"/app", "/app/*", "/VAADIN/*"}, name = "SkyAdminApplicationServlet", asyncSupported = true,
      initParams = {@WebInitParam(name = "org.atmosphere.useBlocking", value = "true")})
  @VaadinServletConfiguration(ui = SkyAdminApplication.class, productionMode = true)
  public static class MyUIServlet extends SpringVaadinServlet {
    private static final long serialVersionUID = 6823788931438099843L;


  public void detach() {

  public void receiveBroadcast(String message) {
    access(() ->, Type.ERROR_MESSAGE));

I’ve created Bean of MyConfiguration class-

@ComponentScans(value = {@ComponentScan("com.skynetwork.entity"), @ComponentScan("com.skyadmin.web.config"), @ComponentScan("com.skyadmin.web.listeners"),
    @ComponentScan("com.skyadmin.web.servlets"), @ComponentScan("com.skyadmin.web.controller"), @ComponentScan("com.skyadmin.web.application"),
    @ComponentScan(""), @ComponentScan("con.skyadmin.web.skynetwork")})
public class WebMvcConfig extends WebMvcConfigurationSupport {
  public MyConfiguration getMyConfiguration() {
    return new MyConfiguration();

Please help how can i fix the issue?