2011-07-27 43 views
1

我正在試着學習Spring Roo,遵循教程Getting Started with Spring Roo'Spring Roo無法解析爲類型'錯誤

但是,當創建AspectJ文件時,Eclipse現在抱怨編譯錯誤。獲得這些錯誤對我來說

唯一的命令是:

mkdir wedding 
cd wedding 
roo 
    project --topLevelPackage com.wedding 
import the Maven project into Eclipse 
    persistence setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT 
    entity --class ~.domain.Rsvp 

現在我已經有一個錯誤列表:

declare cannot be resolved to a type 
entityManager cannot be resolved or is not a field 
id cannot be resolved or is not a field 
The method entityManager() is undefined for the type Rsvp_Roo_Entity 
version cannot be resolved or is not a field 

任何人也遇到過這個問題,並知道如何解決?

回答

2

你在你的Eclipse中安裝了STS和WTP嗎?

你試圖在Roo的控制檯以下:

perform eclipse 

+0

這應該是解決方案。在教程中查找「章節」** IDE集成**出現此命令時:roo>執行​​eclipse ,並說明如何將項目導入到STS-Eclipse:ile>導入>現有項目到工作區 – jbbarquero

+0

並小心本教程。它非常棒,但它已經過時了一些roo命令的語法。在樣本目錄(投票,診所等) – jbbarquero

+0

@Constantiner中嘗試Roo發行版附帶的oones。是的,我在Eclipse中使用了STS,WTP甚至Roo控制檯。謝謝! 「執行日食」工作,現在實際上在項目圖標上,我有AJ,而不是它只是一個Maven項目。所以我想這個問題是「導入maven項目」。我想知道如果我每次添加一些新功能(如JPA)時都要執行「執行日食」。 – stivlo

2

如果您只創建了該項目,並導入它,你必須對現有的Maven項目:

  • 右鍵單擊項目>彈簧工具>啓用Roo的項目性質
  • 右鍵單擊項目>春工具>啓用彈簧工具工具

對我來說,我錯過了第二個,它終於修復了它。

相關問題