有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

意外的Vaadin会话已过期,并行spring引导应用程序

我使用的是Vaadin 8.9.4和Spring boot 2.2.4。释放我有两个spring启动应用程序,第一个应用程序(server.port=8083)和第二个应用程序(server.port=8084)。这两个应用程序都有@SpringUI注释类扩展UI类,如下所示。单击第二个应用程序中的按钮后,第一个应用程序的会话将立即过期,反之亦然。只有当我并行使用两个弦选项卡时,才会发生这种情况。如果我使用两种不同的浏览器,一切正常

这是一种bug吗?我认为这两个应用程序的会话之间没有关系,因为它们在不同的端口上独立运行

注意:我是spring boot的新手,我正在尝试构建2个通过RESTAPI相互通信的micorService

@SpringUI
@Theme("valo")
public class FirstApplicationUI extends UI {

    private static final long serialVersionUID = 9197592298697220144L;

    @Override
    protected void init(final VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        final Label label = new Label("First Application");
        final Button button = new Button("click");

        button.addClickListener(e -> Notification.show("First Application"));

        layout.addComponents(label, button);

        setContent(layout);
    }
}

@SpringUI
@Theme("valo")
public class SecondApplicationUI extends UI {

    private static final long serialVersionUID = 9059755286859361908L;

    @Override
    protected void init(final VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        final Label label = new Label("Second Application");
        final Button button = new Button("click");

        button.addClickListener(e -> Notification.show("Second Application"));

        layout.addComponents(label, button);

        setContent(layout);
    }
}

共 (1) 个答案