Exception deploying JHipster app to Glassfish 4.1

2019-05-30 07:15发布

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条回答
2楼-- · 2019-05-30 07:59

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.

查看更多
登录 后发表回答