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; } }
locally used
mvn spring-boot:run
that's why had no problem web service
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
Post a Comment