Home > Core Java, JSP/Servlets, Struts, Weblogic > ServletContext getRealPath cause problems on Weblogic

ServletContext getRealPath cause problems on Weblogic

Hi All,

Sometime we face issues with the application where some of the Jsp/servlets try to access the resources using getRealPath of the ServletContext class.

The problem is that it works only when you explode the war file. Even there is a CR CR299135 for the weblogic 10+ versions to tackle this issue.

You have to configure the <show-archived-real-path-enabled> flag to let weblogic returns the actual path of the application.

This configuration can be applied 2 ways.

1. Domain Level

2  Application Level

1. For setting Domain Level: Open the config.xml and set the

<web-app-container>

<show-archived-real-path-enabled>true</show-archived-real-path-enabled>

</web-app-container>

2 Now to configure at Application Level, in weblogic.xml

<container-descriptor>

<show-archived-real-path-enabled>true</show-archived-real-path-enabled>

</container-descriptor>

Hope this helps.


Thanks
R Vashi

About these ads
  1. Mahesh
    September 26, 2012 at 10:13 pm | #1

    I am not seeing any weblogic.xml in my Application level and when i added the parameter in Domain level it is not working, do you mean to say WEB.XML ?? Please help me i got stuck from 2 days.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 68 other followers

%d bloggers like this: