简体   繁体   中英

Running Spring boot via IntelliJ run configuration

I have a small Spring boot application version 1.3.3 in IntelliJ 2016.1.2 Whenever I run the application via the command-line with mvn package && java -jar target/build.jar I can access the webapp without any problems. However, when I use a Spring Boot run configuration, the applications is started successfully, but when I go to the webapp, I always get the message 'GET' is not supported.

I recall that I searched for this problem some time ago and it was a known bug in the IDE that also appeared in Eclipse. But I cannot find those posts anymore and therefore cannot access the solution.

Can any of you guys help please?

Thanks in advance. Regards

  1. Check if application.properties (yml) file inside "Working directory" of IDE run configuration. Or define it explicitly in IDE run configuration with spring.config.location property.

  2. Check app startup logs whether declared request mappings appears, like so

2016-06-03 11:50:02,204 INFO [main] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/webapp/1.0/endpoint],methods=[GET]}" onto ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM