[英]How to retrieve weblogic domain home?
hi guys I want to retrieve the name and path of the domain of weblogic from my start up class. 大家好,我想从我的启动类中检索weblogic的名称和路径。 how can i achieve this? 我怎样才能做到这一点?
看看ServerRuntimeMBean的getCurrentDirectory()
Java EE: ServletContext with a Listener can use getRealPath("..."), provided you let your deployment be not as war (where there are no files), but for instance as unpacked war. Java EE:带有Listener的ServletContext可以使用getRealPath(“ ...”), 前提是您不要让部署像战争一样(没有文件),而例如像解压缩战争那样。 Otherwise getRealPath would yield null. 否则,getRealPath将产生null。 Try getRealPath. 尝试getRealPath。
I haven't confirmed this, but you may be able to get at this information using an Application Life Cycle Listener . 我尚未确认这一点,但是您可以使用Application Life Cycle Listener获得该信息。
You can get a AppDeploymentMBea
from the ApplicationContext
in the ApplicationLifecycleEvent
. 您可以从ApplicationContext
中的ApplicationLifecycleEvent
获取AppDeploymentMBea
。 AppDeploymentMBea
has an InstallDir
. AppDeploymentMBea
具有一个InstallDir
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.