This discussion is archived
3 Replies Latest reply: Jun 12, 2012 8:01 AM by RaviJegga RSS

Reading proprties file directly under WEB-INF folder

862484 Newbie
Currently Being Moderated
Hi,

We have ADF fusion web application, which is being deployed as ear in a standalone web-logic server.
The application have several projects, which are bundled as a jar inside the ear, on only one top level project is used to create WAR

The WEB-INF folder of this war contains a properties file.

Now from one of the project which is bundled as jar , i want to read the properties file, but i am not able to get it.

I have already tried using - this.getClass().getClassLoader().getResourceAsStream("/WEB-INF/some.properties"); but this doesn't work.


The fact is that i cant place this file under WEB-INF/classes folder because there is none, also i want to read it directlu under WEB-INF folder

Is there any way by which i can access this file??

thanks-
Ankit
  • 1. Re: Reading proprties file directly under WEB-INF folder
    RaviJegga Expert
    Currently Being Moderated
    Hi Ankit
    First you have to set a flag in your admin console. Login into Weblogic Admin Console. On left side, in Domain Structure Window, click on the parent node which is your Domain name. Click on this. On right side, click on the Tab named "Web Applications". Scroll all the way down and check the box named like "Archive Real Path Enabled". Save and you have to restart the Server. Read the notes about this flag there. Now you should be able to read any .properties file from your WAR fiile.

    Thanks
    Ravi Jegga
  • 2. Re: Reading proprties file directly under WEB-INF folder
    570408 Newbie
    Currently Being Moderated
    HI Ravi , it was nice advice , can u pls let me know how to solve this problem in weblogic 9.2 server.

    that would be really appriciated.

    Thanks a lot
    Peter
  • 3. Re: Reading proprties file directly under WEB-INF folder
    RaviJegga Expert
    Currently Being Moderated
    Hi Peter
    I do NOT have WLS 9.x installed on my local machine. But I am wondering even WLS 9.x should have this Flag. Can you please login into weblogic console and see if this flag is there and apply the solution that I mentioned earlier. It should be there most probably.

    If you are facing some other problem, I would prefer open a new thread and post your issue/problem there.

    Thanks
    Ravi Jegga

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points