问题描述
我正在尝试将我的jHipster app war部署到Glassfish并继续收到以下错误....
I am trying to deploy my jHipster app war on to Glassfish and keep getting the following error....
生命周期方法[initApplication]不得抛出相关的注释信息:注释元素上的注释[@javax.annotation.PostConstruct()] [public void com.org.myapp.Application.initApplication()抛出类型为[METHOD]的java.io.IOException]。
"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]."
阅读一些帖子,看起来像是一个玻璃鱼问题。我也试过帖子''由'dsyer'。那没起效。我仍然有这个问题。
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!
推荐答案
错误消息告诉您已注释 initApplication()
带 @PostConstruct
的方法,其中抛出
-declaration,这不是允许。从签名中删除抛出IOException
,捕获 IOException
,重新抛出 RuntimeException
,错误应该消失。
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.
这篇关于将JHipster应用程序部署到Glassfish 4.1的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!