2017-05-28 46 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項目。我只是點擊該項目,右鍵單擊,並嘗試一堆不同的選項(彈簧應用程序,你好應用程序等)。

相關問題