java—我在GlassFish4上部署xbeanbrokerservice时遇到了一个异常

8ehkhllq  于 2021-07-09  发布在  Java
关注(0)|答案(1)|浏览(351)

我有 activemq-core-5.7.0 在我的web项目中,但是当我尝试在任何服务器(glassfish、tomcat、jboss等)上部署它时,我遇到了下一个错误:

[2014-03-11T12:12:22.013-0500] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=34 _ThreadName=admin-listener(2)] [timeMillis: 1394557942013] [levelValue: 1000] [[
  Exception while deploying the app [ch16] : The lifecycle method [afterPropertiesSet] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet() throws java.lang.Exception] of type [METHOD]
The lifecycle method [afterPropertiesSet] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet() throws java.lang.Exception] of type [METHOD]

你知道会有什么问题吗?或者我该怎么解决???
谢谢您。

42fyovps

42fyovps1#

根据定义,只能在postconstruct()方法上引发runtimeexception。文档链接:https://docs.oracle.com/javaee/5/api/javax/annotation/postconstruct.html
您可以使用try&catch,并在catch语句中插入所需的行为。

相关问题