This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

System.getProperty returns null value  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a properties file at a certain location on my file system. In my application server (Websphere 5.1)I have set a variable in the JVM System Properties that points to the property file. These are the lines of code to access the variable

This all works fine when I test it in RAD on my local machine, but when I deploy this solution to an app server running on Unix I noticed peculiar behavior. (Btw I have setup a variable on the that server too)The first time that I try to bring up the webpage that accesses the properties file, the app server log displays a message
IOException: null/properties.file (No such file or directory)
This leads me to believe that System.getProperty is returning null. However, if I close the browser and open up my webpage again I'm able to access the file.

Is there something I don't know about System.getProperty? Btw getServletContext.getRealPath...etc are not options because the file is at a different location than the application.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!