简体   繁体   中英

I've got an exception when deploying XBeanBrokerService on glassfish 4

I have the activemq-core-5.7.0 within my web project, but when I try to deploy it over any server (glassfish, tomcat, jboss, etc), I got the next error:

[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]

Any idea what could be the problem or how could I solve it???

Thank you.

By definition you can only throw a RunTimeException on PostConstruct() method. A link to the documentation : https://docs.oracle.com/javaee/5/api/javax/annotation/PostConstruct.html

You can use a try&catch - and insert the behaviour you want on the catch statement.

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