Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好,我正在使用 Weblogic11,EJB3.0
我在集群工作。我想在 Java 代码中检索当前服务器名称(实例/id)。因为我想在一台服务器上进行一些操作,而在另一台服务器上进行不同的操作
谢谢,
射线。
如果您查看命令行参数,您将看到 -Dweblogic.Name=[ServerName]。您可以从 Java 环境参数中获取此信息。您可以通过以下方式访问它:
System.getProperty("weblogic.Name")