我想在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