简体   繁体   中英

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. 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. Otherwise getRealPath would yield null. Try getRealPath.

I haven't confirmed this, but you may be able to get at this information using an Application Life Cycle Listener .

An example here .

You can get a AppDeploymentMBea from the ApplicationContext in the ApplicationLifecycleEvent . AppDeploymentMBea has an InstallDir .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM