Home > Mobile >  Error 404 Not Found when I am using Tomcat WAR file
Error 404 Not Found when I am using Tomcat WAR file

Time:05-17

I am working on a project in Tomcat , Java EE and added a WebSocket to a project and created a simple chat with it.

Locally everything worked fine but when I created the WAR file and launched the application with it, the WebSocket part of the project causes the following error:

enter image description here

I am using 9.0.38 Tomcat version.

Apart from this one problem, the whole app works fine.

Do you have an idea how to fix it?

CodePudding user response:

What's look like your Websocket dependency in your pom.xml file?

The scope of WebSocket dependency must be provided if already isn't:

<!-- https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api -->
<dependency>
    <groupId>javax.websocket</groupId>
    <artifactId>javax.websocket-api</artifactId>
    <version>1.1</version>
    <scope>provided</scope>
</dependency>

CodePudding user response:

I used dependency javax.websocket, but it turned out that the problem was only with my Mozilla Firefox browser. If someone also had this problem, I recommend checking it on Chrome or Edge because it worked for me.

I still don't know what the problem with Firefox is, but in my case I don't have to solve it - it's important that it works on other browsers.

Thank you Mehdi Rahimi for your help.

  • Related