开发者

How can I determine the J2ee application server type and version?

开发者 https://www.devze.com 2022-12-18 06:51 出处:网络
I开发者_运维百科 need to detect information about the Application Server my EJBs are running in.

I开发者_运维百科 need to detect information about the Application Server my EJBs are running in. The System.properties contain a lot of information about Java and the Operating system, but I need to know what type of application server and if possible even the version.

Is there a way to get this information in an application independent way (JMX maybe) ?

Alternatively, is there a WebSphere specific way of getting this information ?


You could try ServletContext.getServerInfo(), though I'm not sure what specific information WebSphere will give you with that. On Tomcat I get the string e.g. "Apache Tomcat/6.0.16"


Take a look through the WAS MBeans that are available. It looks like the Server MBean may have some of the info you're looking for.


There is no guarantee you are allowed to check system properties.

What is the problem you need to solve?

0

精彩评论

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