简体   繁体   中英

Run/Debug Spring Boot application from Eclipse JEE Neon alone?

I will keep this quick.

I am following an example from the Spring documentation listed here . As I am using Gradle, I am able to run the application by using:

./gradlew bootRun. 

Or I can build the JAR file using

./gradlew build

running the jar file

While all of this runs as instructed, that's kind of a pain. When I show this app to my boss, I would like to run it directly through the IDE. Whenever I right click the project (or even just the application class) as try to run it, the service doesn't work and just takes me to the following error:

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sat May 27 22:32:23 EDT 2017
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template "greeting", template might not exist or might not be accessible by any of the configured Template Resolvers

I googled this and can't seem to find a solution. I have tried creating a src/main/resource/static/home.html , but it did not work.

IS there anyone who can help me with this issue? Just for the record, the application.properties file currently reads as:

spring.mobile.devicedelegatingviewresolver.enabled: true

Fixed it.

So there were a couple things going on...

The main thing is that you have to actually open the project in package explorer, select the app class, right click and run as a java project. I was just clicking on the project, right clicking, and trying a bunch of different options (spring application, hello application, etc).

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