I need to convert an application to war and run it via Tomcat. I made the application war with maven. But when I upload this war file to tomcat and try to run it on localhost, I get an error like this.
Can you help me with this?
The application link
https://github.com/spring-projects/spring-petclinic
My operating system is Debian.
In tomcat-users.xml I added
<user username="war-deployer" password="maven-tomcat-plugin"
roles="manager-gui, manager-script, manager-jmx" />
In maven settings.xml I added
<server>
<id>maven-tomcat-war-deployment-server></id>
<username>war-deployer</username>
<password>maven-tomcat-plugin</password>
</server>
In pom.xml i added
...
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
<version>2.7.0-SNAPSHOT</version>
<packaging>war</packaging>
...
<!-- Configure the Tomcat Maven plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:9090/manager/text</url>
<path>/rps</path>
</configuration>
</plugin>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope> <!-- This is important. -->
</dependency>
I'm typing this command via terminal inside of webapps/ folder to get .war
mvn clean package