A
A
Anton Voskoboev2021-04-12 22:23:28
Java
Anton Voskoboev, 2021-04-12 22:23:28

How to deploy war on Tomcat 10?

I transfer the project from the 9th to the 10th version of Tomkat and ran into a problem. I put war in webapps, I configure Tomcat in the same way as in the 9th version, but I get a 404 response.

server.xml

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="false">
    <Context path="" docBase="MyWar"></Context>

    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>


Who faced similar?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis I., 2021-12-14
@Besyzr

if your war is built with javax.* packages and not jakarta.* , then like this:
create a webapps- javaee directory next to webapps and put your .war there.
The 10th Tomcat will convert the javax.* application to jakarta.* and place the application already working in the new environment in webapps.
https://tomcat.apache.org/migration-10.html#Specif... :

Tomcat can convert an existing web application from Java EE 8 to Jakarta EE 9 at deployment time using the Apache Tomcat migration tool for Jakarta EE. To make use of the feature, the web application should be placed in the Host legacyAppBase folder (by default named webapps-javaee) and they will be converted to an equivalent Jakarta EE web application in the Host appBase folder (by default named webapps).

D
Dmitry Roo, 2021-04-12
@xez

Try
autoDeploy="true"

A
Anton Voskoboev, 2021-10-15
@Besyzr

How to deploy war on Tomcat 10?

Don't deploy at all, because Spring MVC 5 does not work on Tomcat 10.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question