vaadin 消息警告:试图注销

vaadin msg WARNING: Tried to unregister

com.vaadin.ui.ConnectorTracker unregisterConnector WARNING: Tried to unregister (83) which is not registered

这是我导致此警告的代码。它用小程序组件插件替换了一个简单的组件。

On click of a button calls appletConponent.handleClick()

小程序有效,但我在日志中看到警告消息。

    static class AppletComponent extends  CustomComponent{
    Component  appletComponent;
    VerticalLayout  container;
    String contextRoot;

    void construct(){
        container= new VerticalLayout();
        setCompositionRoot(container);
        contextRoot=VaadinServlet.getCurrent().getServletContext().getContextPath();
        // initialize with empty component
        container.addComponent(appletComponent= new Label());
    }
    void handleClick(){
            addApplet();
        }
    }

    void addApplet(){
        try{
            String appletParam=gatesSession.getPathParameter();
            Component  oldComponent=appletComponent;
            Component  newComponent=new AppletIntegration() {
                private static final long serialVersionUID = 1L;
                @Override
                public void attach() {
                    // applet codebase,archive url 
                }
          };
          container.replaceComponent(oldComponent, newComponent);
          appletComponent= newComponent;
        }catch(Exception e){
            logger.error(" could not create session ",e);
            Notification.show("Cannot Launch  ","failed"+ e.getMessage(),Type.ERROR_MESSAGE);
        }
    }

覆盖组件的 attach() 方法时,记得同时调用 super.attach()

@Override
public void attach() {
    super.attach(); // Don't forget this!
}

同样适用于detach()