I created on my local computer (windows) a spring-boot project that runs a tomcat server.
Code:
@RestController
public class ServerController {
@Autowired
private CalculateService calculateService;
@RequestMapping ("/demo")
public int demo () {
return 999;
}
I ran, and saw that "http://localhost:8080/demo" returns 999.
I packaged it to a war file - "demo-0.0.1-SNAPSHOT.war", and copied it into the "/usr/java/apache-tomcat-8.5.40/webapps/" folder, in a linux instance of a aws ec2 server.
When I run /.startup.sh, is starts with:
Using CATALINA_BASE: /usr/java/apache-tomcat-8.5.40
Using CATALINA_HOME: /usr/java/apache-tomcat-8.5.40
Using CATALINA_TMPDIR: /usr/java/apache-tomcat-8.5.40/temp
Using JRE_HOME: /
Using CLASSPATH: /usr/java/apache-tomcat-
8.5.40/bin/bootstrap.jar:/usr/java/apache-tomcat-8.5.40/bin/tomcat-juli.jar
Tomcat started.
When i enter in my computer browser the url:
<instance url>:8080
the Apache Tomcat/8.5.40 home page loads. But when i call the demo server from the ec2:
wget http://localhost:8080/demo-0.0.1-SNAPSHOT/demo
or from outside by
<instance url>:8080/demo-0.0.1-SNAPSHOT/demo
it returns returns 404.
Deleting the default "web-apache.war" file from "webapps" folder, doesn't fix the problem.
What i need to change in the configurations?