Hidayat Rzayev
Hidayat Rzayev

Reputation: 389

Tomcat - Failed to start component when versions don't conflict

I'm trying to work with servlets, so I created a Java EE project on a Tomcat server. As you can see below, I have an environment variable JAVA_HOME, which holds the path to JDK 10. The Java version also defaults to 10, however when I start my Tomcat server, I get the highlighted error.

enter image description here

The problem arose after I created a servlet and tried to map it like in the screenshot below.

enter image description here

enter image description here

In my project I also use the 10th version of Java. I don't quite get what the problem is here, so any hint would help.

P.S.: similar questions like this one did not solve my problem

Upvotes: 0

Views: 316

Answers (1)

Arvind Kumar Avinash
Arvind Kumar Avinash

Reputation: 79085

The URL pattern must start with a /.

Replace

<url-pattern>add</url-pattern>

with

<url-pattern>/add</url-pattern>

Upvotes: 1

Related Questions