我想在jHipster應用程序啓動後執行方法。我應該在哪裏放我的方法? 我試圖在MyApp.java
方法運行我的方法:jHipster應用程序啓動後的執行方法
@PostConstruct
public void initApplication()
但我得到的錯誤:
Invocation of init method failed; nested exception is org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: xxx.xxx.xxx
xxx.xxx.xxx.cars, could not initialize proxy - no Session
我嘗試了您的解決方案,但仍然出現相同的錯誤。 – Ice
也許如果你編輯你的問題,並添加更多的細節,我將能夠提供幫助。 @gaelmarziou答案對你有幫助嗎? – matthieusb