在Java应用程序中查找WebSphere版本。

huangapple go评论60阅读模式
英文:

Finding the websphere version in java application

问题

这是一个非常常见的问题,我们经常需要从一个Java应用程序中查找已安装在WebSphere上的Java版本,但是如何从Java应用程序中找到WebSphere版本本身呢?我的Java应用程序存在于同一服务器上,请帮忙。

我知道一种解决方案是将版本号添加为环境变量并在应用程序中读取它。但是我正在寻找一种无需向WebSphere添加任何内容的解决方案。

英文:

Its very common question to find the java version installed on the websphere, but how do we find the websphere version itself from an java application? My java application exists on the same server, please help.

I am aware of solution to add the version as the enviroment variable and reading it an app. But I am looking for a solution where in we don't have to add anything to WAS.

答案1

得分: 3

使用 Server MBean 可以在部署的应用程序内编程方式访问产品版本信息。serverVersion 属性将提供您所需的信息以及更多内容。在脚本环境中,您有几个选项涉及 wsadmin 对象:使用 AdminTask 对象访问 server MBean 的 serverVersion 属性;或者使用 AdminControl.getNodeBaseProductVersion 命令。最后,您可以从命令行使用 versionInfo 命令。- 致敬。

英文:

Use the Server MBean to programatically access product version information within your deployed application. The serverVersion attribute will provide the information you need and then some. Within a scripting environment you have a couple options involving wsadmin objects: Use the AdminTask object to access the serverVersion attribute of the server MBean; or, use the AdminControl.getNodeBaseProductVersion command. Finally, from the command line use the versionInfo command. -Regards.

huangapple
  • 本文由 发表于 2020年5月29日 22:50:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/62088697.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定