如何将 Vaadin 22 部署到 Tomcat 8.5

发布于 2025-01-09 21:57:15 字数 1154 浏览 4 评论 0原文

我使用 链接下载了 Vaadin22 入门应用程序。使用嵌入式服务器一切正常。

但是部署到 Tomcat 8.5.35 会在 localhost.log 中引发以下错误(我也尝试使用 V14 和 V23,同样的问题):

java.lang.IllegalStateException: The application Lookup instance is not found in the interface com.vaadin.flow.server.VaadinContext instance. It means that the container has not executed Lookup initialization code: so either the container is not Servlet 3.0 compatible or project configuration is broken.
    at com.vaadin.flow.server.startup.ApplicationConfiguration.lambda$get$0(ApplicationConfiguration.java:58)
    at com.vaadin.flow.server.VaadinServletContext.getAttribute(VaadinServletContext.java:73)

因此 servlet 被取消部署。

为了部署到生产环境,我在 pom.xml 中切换到 war-packaging,并使用 mvn clean package -PProduction 执行构建。之后,我将 .war 文件手动复制到 Webapps-Location。

错误消息提到了 Servlet 3.0 兼容性。但是这个Tomcat文档明确指出Tomcat 8.5支持Servlet 3.1

任何帮助表示赞赏。

I downloaded a Vaadin22 starter-app using this link. Everything works fine using the embedded Server.

But deploying to Tomcat 8.5.35 raises the following error in localhost.log (I tried also with V14 and V23, same issue):

java.lang.IllegalStateException: The application Lookup instance is not found in the interface com.vaadin.flow.server.VaadinContext instance. It means that the container has not executed Lookup initialization code: so either the container is not Servlet 3.0 compatible or project configuration is broken.
    at com.vaadin.flow.server.startup.ApplicationConfiguration.lambda$get$0(ApplicationConfiguration.java:58)
    at com.vaadin.flow.server.VaadinServletContext.getAttribute(VaadinServletContext.java:73)

As a result the servlet is undeployed.

To deploy to production I switched to war-packaging in pom.xml and executed the build with mvn clean package -Pproduction. Afterwards I copied the .war-File manually to the Webapps-Location.

The error message mentions Servlet 3.0 compatibility. But this Tomcat documentation clearly states that Tomcat 8.5 supports Servlet 3.1.

Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文