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 athrows
-declaration, which is not allowed. Remove thethrows IOException
from its signature, catch theIOException
, rethrow aRuntimeException
, and the error should disappear.