How to retrieve weblogic domain home?
hi guys I want to retrieve the name and path of the domain开发者_如何学Python of weblogic from my start up class. how can i achieve this?
Take a look at the getCurrentDirectory()
of ServerRuntimeMBean
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
.
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.
精彩评论