简体   繁体   中英

Exception deploying JHipster app to Glassfish 4.1

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM