java - Web service stopped working after deploy -


it works locally on localhost. tried deploy on heroku , aws. doesn't work. static resources ok. response 404.

@springbootapplication @restcontroller public class webservice implements webserviceinterface{      public static void main(string[] args) throws throwable {         springapplication.run(webservice.class, args);     }      @override     @requestmapping("/getcontent")     public webcontent getcontent(@requestparam(value="id", defaultvalue="summary") string id) {         try {             return new webcontent(id);         } catch (ioexception e) {             e.printstacktrace();         }         return null;     } } 

  1. locally used

    mvn spring-boot:run

that's why had no problem web service

  1. for heroku , aws deployed war package. didn't work code. initializer helped solve problem:

    public class servletinitializer extends springbootservletinitializer {    @override   protected springapplicationbuilder configure(springapplicationbuilder application) {     return application.sources(application.class);   } } 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -