Exception deploying JHipster app to Glassfish 4.1

蹲街弑〆低调 提交于 2019-12-08 04:24:24

问题


I am trying to deploy my jHipster app war on to Glassfish and keep getting the following error....

"The lifecycle method [initApplication] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void com.org.myapp.Application.initApplication() throws java.io.IOException] of type [METHOD]."

Reading over some posts, it looks like a glassfish issue. I also tried the suggestions from the post 'https://github.com/spring-projects/spring-boot/issues/1355' by 'dsyer'. It did not work. I am still having the issue.

Has anyone encountered this issue? How did you get over it? Really appreciate any help!


回答1:


The error message tells you that you have annotated your initApplication() method with @PostConstruct which has a throws-declaration, which is not allowed. Remove the throws IOException from its signature, catch the IOException, rethrow a RuntimeException, and the error should disappear.



来源:https://stackoverflow.com/questions/33767537/exception-deploying-jhipster-app-to-glassfish-4-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!