无法使用maven部署Tomcat9应用程序
我必须使用 Apache 基金会开发的 Guacamole 应用程序在 Ubuntu 服务器上实现一个 Web 应用程序。为了了解如何操作它,我遵循了他们的官方文档,并尝试编写自己的应用程序,但我无法达到所述应用程序。
这个问题似乎不是来自 Tomcat 本身,因为它成功地托管了其原始的鳄梨酱客户端,如上述文档中所示。但是,当我尝试将自己的代码放入 tomcat9/webapp/ 目录时,Tomcat 无法启动该应用程序。经理能够识别它,并且该应用程序实际上显示在应用程序列表中,但是如果我尝试点击“开始按钮”,我会收到一条错误消息:(
FAIL - The application for the given context path [/guacamole-tutorial-1.4.0] can't be started
此处的消息可能不准确,因为它是以我的语言显示,我必须翻译它)
我尝试在互联网上搜索一些帮助,但到目前为止我还没有找到任何解决方案。我看到很多人说只要发生此类问题就应该检查日志,但我的没有任何错误条目。该文件仅以以下两行结尾:
2022 06:47:10,753 INFOS [http-nio-8080-exec-29] org.apache.catalina.core.ApplicationContext.log HTMLManager : start: Starting web application '/guacamole-tutorial-1.4.0'
2022 06:47:10,753 INFOS [http-nio-8080-exec-35] org.apache.catalina.core.ApplicationContext.log HTMLManager : list Listing contexts for virtual host 'localhost'
我的应用程序被部署为 .war 文件,与鳄梨酱客户端位于同一位置,实际上可以正常工作。我使用 Maven 来编译该项目,如 Guacamole 文档中所述,并使用 Nginx 作为 Tomcat 的反向代理。
提前致谢。
I have to realise a web application, on a Ubuntu server, using the Guacamole application, that has been developped by the Apache foundation. In order to understand how to manipulate it, I followed their official documentation, and tried to code my own application, but I can't manage to reach the said application.
The issue doesn't seem to come from Tomcat itself, for it sucessfully manages to host their original guacamole client, given in the said documentation. However, when I try to put my own code in the tomcat9/webapp/ directory, Tomcat just isn't able to launch the application. The manager is able to recognise it, and the app is actually displayed in the app list, but if I try to hit the "start button", I get an error that says :
FAIL - The application for the given context path [/guacamole-tutorial-1.4.0] can't be started
(The message may not be exact here, for it is displayed in my language, and I had to translate it)
I tried to search on internet some help, but I haven't been able to find any solution so far. I've seen a lot of people saying that one should check the logs whenever such issue occurs, but mine doesn't have any error entry. The file just ends up with the two following lines :
2022 06:47:10,753 INFOS [http-nio-8080-exec-29] org.apache.catalina.core.ApplicationContext.log HTMLManager : start: Starting web application '/guacamole-tutorial-1.4.0'
2022 06:47:10,753 INFOS [http-nio-8080-exec-35] org.apache.catalina.core.ApplicationContext.log HTMLManager : list Listing contexts for virtual host 'localhost'
My application is deployed as a .war file, in the same location as the guacamole clients, that actually works. I use Maven to compile the project, as told in Guacamole's documentation, and Nginx as a reverse proxy for Tomcat.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过几天的研究,我设法找到了错误的根源,这是由于我的 web.xml 文件而发生的。首先,与教程所说的不同,它不应该以标签开头,而应该以 : 开头。
然后,我还发现 Guacamole 文档告诉如何声明 servlet 的方式是错误的。修复后,我的应用程序成功了。
我希望这能帮助任何其他因鳄梨酱而苦苦挣扎的人。我还将添加两个页面来帮助我理解如何编写 web.xml 文件:
http://www-igm.univ -mlv.fr/~dr/XPOSE2003/tomcat/tomcat.php?rub=16
https://mkyong.com/maven /如何使用-maven 创建网络应用程序项目/
After a few days of research, I managed to find the origin of the error, that happened because of my web.xml file. First, unlike what the tutorial said, it shouldn't begin with the tag, but with :
Then, I also found out that the way the Guacamole documentation tells how to declare the servlet is wrong. After fixing it, my application worked out.
I hope that this will help any other person that struggles with that part of Guacamole. I'll also add two pages that helped me understanding how to write the web.xml file :
http://www-igm.univ-mlv.fr/~dr/XPOSE2003/tomcat/tomcat.php?rub=16
https://mkyong.com/maven/how-to-create-a-web-application-project-with-maven/