java - custom message properties in scala play framework for removing hard coded string -


this below code getting keyword value text file works in localhost. when put code in aws server, works only. returns value keyword returns null

package models import java.io.fileinputstream import java.io.fileoutputstream import java.util.properties import scala.language.postfixops  object msgmodel {    def getkeyword(msgkeyword: string) = {     var fileinput = new fileinputstream("./conf/keywords");     val properties = new properties     properties.load(fileinput);      var out = new fileoutputstream("./conf/keywords");     properties.store(out, null);     val point = properties.getproperty(msgkeyword)      val key = properties.keyset()     val data = point     fileinput.close();     out.close();     data   } } 

some times

msgmodel.getkeyword("jid")//some times returns jid, expected msgmodel.getkeyword("jid")//some times return null 

file:keywords.txt

jid=jid 

why works only?

i suspect issue of not having file present in 1 of underlying servers aws load balancer route traffic to. try return ip or unique identifier of system along result , notice if different in case of expected result , null value?


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -