2012-01-22 43 views
1

我有創建和管理的袋鼠一個持久層(JPA實體對象)。它在它自己的項目中,構建到一個jar中,並且我已經將它與一個單獨的Spring MVC 3 Web應用程序一起使用。如何在Apache Wicket中使用Spring Roo?

我想由Apache Wicket的另一個Web應用程序來使用同樣的袋鼠持久性項目。我見過一對夫婦檢票取得了Roo的附加組件,但沒有人甚至編譯(我不是有問題的唯一一個)。

我遇到的問題是,每當我試圖打電話給我Roo的實體之一,從檢票頁面或組件中,我得到以下異常:

Caused by: java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?) 
at com.x.domain.UserAccount_Roo_Entity.ajc$interMethod$com_x_domain_UserAccount_Roo_Entity$com_x_domain_UserAccount$entityManager(UserAccount_Roo_Entity.aj:91) 
at com.x.domain.UserAccount.entityManager(UserAccount.java:1) 

我已經配置我的應用程序的春天以下+檢票維基這裏:https://cwiki.apache.org/WICKET/spring.html

有誰知道1,2,3步驟設置一個Wicket應用程序利用Spring Roo的實體?任何幫助表示讚賞。謝謝!

回答

0

我找到了解決我的問題。當我使用Maven碼頭運行我的檢票webapp時:運行目標,它工作。不過,我試圖通過Java代碼啓動碼頭:

public class Start { 

public static void main(String[] args) throws Exception { 
    Server server = new Server(); 
    SocketConnector connector = new SocketConnector(); 
    server.start(); 
    } 
} 

我沒有在這個「開始」類加載Spring的ApplicationContext。一旦我修改這個類加載Spring應用程序上下文,它的工作