Topic
1 reply Latest Post - ‏2013-09-04T05:33:08Z by U4UE_xie_zhi
airFNguitarist
airFNguitarist
1 Post
ACCEPTED ANSWER

Pinned topic Load Properties file in WAS CE

‏2013-06-05T19:51:48Z |

I want to load a properties file to be used by my Web Application in WAS CE.

When I do it on websphere ND or sun One I include it in the jvm arguments as a '-D' parameter for eg.

-Dgiadmingui.properties=<INSTALLED_APP_DIR>/GiAdmin_war.ear/GiAdmin.war/WEB-INF/classes/giadmingui.properties

I tried putting this param in the setenv of WAS CE, but it did not work. In fact I placed it in almost every directory after the war was extracted in the repository, but WAS CE cannot seem to find it.

In the code, I am accessing the file as:

try
    {
      this.initprop = new Properties();
      this.initprop.load(new FileInputStream("giadmingui.properties"));
    }

And the exception I'm getting is:

java.io.IOException: java.io.FileNotFoundException: giadmingui.properties (The system cannot find the file specified) giadmingui.util.Util.setPropertyFile(Util.java:105) giadmingui.util.Util.initialise(Util.java:162)

I'm using WAS CE 2.1..1.6

Please tell me how to make WAS CE load this properties file. Any help would be greatly appreciated.

Thanks,

Vinay

  • U4UE_xie_zhi
    U4UE_xie_zhi
    54 Posts
    ACCEPTED ANSWER

    Re: Load Properties file in WAS CE

    ‏2013-09-04T05:33:08Z  in response to airFNguitarist

    It looks like the properties is not in the classes path. Could you show the complete log?