将 JHipster 应用程序部署到 Glassfish 4.1 时出现异常

Exception deploying JHipster app to Glassfish 4.1

我正在尝试将我的 jHipster 应用程序 war 部署到 Glassfish 上并不断收到以下错误....

"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]."

阅读一些 posts,它看起来像一个 glassfish 问题。我还尝试了 'dsyer' post 'https://github.com/spring-projects/spring-boot/issues/1355' 的建议。它不起作用。我仍然有问题。

有人遇到过这个问题吗?你是怎么克服的? 非常感谢任何帮助!

错误消息告诉您您已经使用 @PostConstruct 注释了 initApplication() 方法,其中有一个 throws 声明,这是不允许的。从其签名中删除 throws IOException,捕获 IOException,重新抛出 RuntimeException,错误应该消失。