开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜