如何将 Vaadin 22 部署到 Tomcat 8.5
我使用 此 链接下载了 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论