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

断了今生、忘了曾经 提交于 2019-12-23 21:02:43

问题


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 ?


回答1:


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.




回答2:


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"




回答3:


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

What is the problem you need to solve?



来源:https://stackoverflow.com/questions/2117704/how-can-i-determine-the-j2ee-application-server-type-and-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!