2017-05-28 88 views
0

我会保持这个快速。单独从Eclipse JEE Neon运行/调试Spring Boot应用程序?

我正在关注the Spring documentation listed here的一个示例。由于我使用的摇篮,我能够通过使用来运行应用程序:

./gradlew bootRun. 

或者,我可以建立使用

./gradlew build 

虽然这一切正在运行的jar文件

JAR文件按指示运行,这是一种痛苦。当我将这个应用展示给我的老板时,我想直接通过IDE运行它。每当我右键单击该项目(甚至只是应用程序类)的尝试运行它,该服务无法正常工作,只是带我到以下错误:

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 

我一派这似乎并不能找到解决方案。我曾尝试创建一个src/main/resource/static/home.html,但它不起作用。

有没有人可以帮助我解决这个问题?只是为了记录,application.properties文件当前显示为:

spring.mobile.devicedelegatingviewresolver.enabled: true 
+0

我已经得到它与maven和m2e一起工作,从来没有回到工作gradle(或sbt)。你有STS吗? –

+0

下载eclipse的gradle插件。点击你的项目'gradle - > refresh'并运行它作为Spring启动应用程序。 –

+0

错误是抱怨缺少'greeting.html',为什么要添加'home.html'帮助?另外,当使用Gradle项目时,确保您使用Eclipse的Gradle插件来导入项目,否则不会将其添加到类路径中。 –

回答

0

修正了它。

所以有一对夫妇的事情怎么回事...

主要的事情是,你必须真正在包Explorer中打开该项目,选择app类,右键点击并运行一个Java项目。我只是点击该项目,右键单击,并尝试一堆不同的选项(弹簧应用程序,你好应用程序等)。

相关问题