开发者

How to get the Version Number for JBoss 7 from within a WAR?

开发者 https://www.devze.com 2023-04-09 06:29 出处:网络
For older JBoss these mechanis开发者_JAVA百科ms worked : Check for Class org.jboss.mx.util.MBeanServerLocator

For older JBoss these mechanis开发者_JAVA百科ms worked :

  • Check for Class org.jboss.mx.util.MBeanServerLocator
  • Then use JSR77: Look for a JMX MBean with *:j2eeType=J2EEServer,* and get the attribute serverVersion

or

  • Check for an MBean with name jboss.system:type=Server and get the value of attribute Version

But for JBoss 7 neither MBean exists (nor any suitable class to check, with the WAR sitting in its OSGi cage). All I can do is for searching the JMX domain jboss.modules: if it exists infer that this is a Jboss 7.

Is there a way to get the exact version number from within a WAR's init() ?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号