Unable to deploy a Tomcat9 application using maven

194 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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 :

 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

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/