You can refer to the CR CR299135 for weblogic version 10 and above.
Use the <show-archived-real-path-enabled> flag to specify that
context.getRealPath() returns the path of the resource from the Server's
internal webapp extraction directory for archived web applications. The
flag can be configured in two ways:
- At domain level in config.xml. For example:
- At the web app level in weblogic.xml. For example:
The value of <show-archived-real-path-enabled> set in the web app has
precedence over the value set at the domain level. The default value of
this property is false.
Note that, if this path is used to dynamically copy some content to this
directory location, the content will end up in the Server's internal web
app extraction directory. When the web app is recompiled for any reason,
the web app may be re-extracted and previously copied content will be
String rootPath = StringUtils.replace(context.getRealPath(StringUtils.EMPTY), "", "/");
You will no longer see the issue.
Hope this helps some one who struggles with weblogic NOT AGAIN