Tomcat Server returns error 404 … And no, I don't use web.xml, .jsp or .html files

1 answer

I've deployed my spring-boot server to AWS for the first time and for some reason it doesn't work. I did everything as in the guide but it returns "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.", although when I run it at my localhost, it works properly. Does anybody know what could be causing it? (I think maybe I somehow incorrectly generate war file or sth)(please tell if you need any code examples) Order of my actions:
0. Created AWS account.
1. Configured building of WAR files(firstly created war-exploded configuration, then simply war configuration, attached to war-exploded, because in other case I'd have to create empty war config and set it up by myself)
2. Created Elastic Beanstalk web-server environment with newest Tomcat platform and uploaded war file.
3. Waited... and tried to open auto-generated URL.
And then I saw 404 Tomcat error. I tried to generate different war files(and once jar), upload them, created a few new environments, but nothing changed((
Code of main class:

import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import springfox.documentation.swagger2.annotations.EnableSwagger2;  @SpringBootApplication @EnableSwagger2 public class HeysmellApplication {      public static void main(String[] args) {         SpringApplication.run(HeysmellApplication.class, args);     }  } 

And controller(I have another one, this is just to handle base request in order to check whether server works or not, but it works on my localhost):

import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;  @RequestMapping("/") @RestController public class MainController {     @GetMapping("/")     public String getMain(){         return "Hello, it's my API"; }     @GetMapping("/help")     public String getHelp() {         return "not implemented, sorry";     } } 

All answers to this question, which has the identifier 61237690

The best answer:

Ok, I found a solution. The main problem was that Elastic Beanstalk need port 5000 to work properly, after I changed it my server started to handle requests. But, it only works with jar files and when I try to deploy war file the problem remains the same. In any case, it works and that's enough for me.

Last questions

how do i remove the switch on my home screen?
how to edit the JS date and time to update atuomatically?
How to utilize data stored in a multidimensional array
Powermockito not mocking URL constructor in URI.toURL() method
Android Bluetooth LE Scanner only scans when phone's Location is turned on in some devices
docker wordpress container can't connect to mysql container
How can I declare a number in java that is more than 64-bits? [duplicate]
Optaplanner solutionClass entityCollectionProperty should never return null error when simple JSON object passed to controller
Anylogic, get the time a pedestrain is in a queue
How do I fix this syntax issue with my .flex file?
Optimizing query in PHP
How to find the highest number of a column and print two columns of that row in R?
Ideas on “Error: Type com.google.firebase.iid.zzav is referenced as an interface from com.google.firebase.messaging.zzd”?
JCIFS SmbFile.exists() and SmbFile.isDirectory() return false when it exists and I can listFiles()
PHP total order
Laravel booking system design
neural net - undefined column selected
How to indicate y axis does not start from 0 in ggplot?
Fragments in backStack
Spinner how to change the data