Best approach to change values in .properties file dynamically

Hi ,
I am using Jdev 11.1.1.5 . I wanted to change the values used in .properties file (like say a fe email addresses which happen to be different for Test/Prod/Dev instances) dynamically using something like a deployment plan.
One way to do the same is to include it in a shared libary and do a one -time deployment to the server.
Are there any better ways like a deployment plan , which unfortunately I think can change values dynamically on for web.xml , weblogic.xml type of files.

I am using a shared library which takes care of the cases mentioned above.

Similar Messages

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Multiple values in properties file?

    Could someone please tell me the best way to assign and load mulitple values for one property in a properties file?
    For example, my properties file might have an entry like this:
    columnsToUpdate=FIRST_NAME, LAST_NAME, ADDRESS
    So when I call Properties.load(), how can I initialize a String[], instead of a String, on the value(s) of columnsToUpdate? There isn't a method which returns an array that I know of.
    Do I have to read it in as a String, then tokenize it manually, and then initialize the String[] on the tokens, or is there a better way?
    Thanks,
    Erik

    Hi,
    I'm sorry but appareantly there is an internal problem with the getStringArray method. I didn't realize that, I was only going through the docs.
    - You can extend the ResourceBundle class and override the handleGetObject method
    - You can use the ListResourceBundle class
    - Or you can use a regular Properties object and split the string with the StringTokenizer
    I'm sorry for this inconvenience.
    Regards,
    Kurt.

  • Changing values in property file inside a jar in an ear

    Hi,
    I have an application that contains EJB. The environment values needed for initial context of the ejb is kept in a .properties file. I have created an ear of the application. Inside the ear there is a jar which contains the .properties file. I need to deploy the ear to different environments. However before deploying I need some kind of script to change the values in the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using ANT/WLST)

    WLST does not have any capability to update a JAR.
    WLS 10.3 (still in tech preview) has the ability to override properties
    files inside the jar with an external properties file. This would allow you
    to deploy the same ear to different environments, and then only deploy a
    different properties file in the plan directory.
    <Rishi Shah> wrote in message news:[email protected]..
    Hi,
    I have an application that contains EJB. The environment values needed for
    initial context of the ejb is kept in a .properties file. I have created an
    ear of the application. Inside the ear there is a jar which contains the
    .properties file. I need to deploy the ear to different environments.
    However before deploying I need some kind of script to change the values in
    the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using
    ANT/WLST)

  • Best approach to change historichal data???

    Hi experts,
    As a requirement of our project, R/3 will periodically do a material (key) value change upon existing product, that is, update the product code with a new one that substitutes the old one.
    Ex: Material A (code M10013) turns Material B (code M10014).
    We want to realign all historichal data stored in BW from the old material code (M10013) to the new one (M10014).
    Question is whether there is a standard way to do this within BW.
    If not, what would be the best approach to dela with this?
    Thanks in advance for your help,
    Best regards,
    Enric
    Note: I have faced this same requirement in APO, and there's a Realignment functionality to convert CVCs, but I'm not sure if we have a similar tool in BW.

    Hi,
    Use Data Mart Concept.
    Load all the historical data of the old with the new material code to a new ODS
    then again pull the data from the new ODS to the existing one.
    hope this helps,
    regards
    suresh

  • Reading values from properties file

    Hi All,
    I am in need of a help from you all.I have a login.jsp which gets username and password as user input and checks in the servlet that if it was admin and admin it will take to index.jsp and if it was other than admin and other users it should take to index1.jsp.For now i am using an if condition to check the values and to dispatch the request.I need to use a properties file for this and need to check by getting the values from the properties file.And also it should check for each entry in properties file and if it finds any matches it should take to the corresponding page.
    Please help me in achieving this.
    Thanks,
    laxmi

    Hi All,
    I am in need of a help from you all.I have a login.jsp which gets username and password as user input and checks in the servlet that if it was admin and admin it will take to index.jsp and if it was other than admin and other users it should take to index1.jsp.For now i am using an if condition to check the values and to dispatch the request.I need to use a properties file for this and need to check by getting the values from the properties file.And also it should check for each entry in properties file and if it finds any matches it should take to the corresponding page.
    Please help me in achieving this.
    Thanks,
    laxmi

  • How can i remove a key and its value from properties file

    hi all,
    i want remove a particular key and associated value from the
    properties file. is their any standard way of doing?
    thanks inadvance
    daya

    hi,
    thanks
    i am able to remove the key,
    one more question how can avoid storing date and time
    in properties file.
    thanks
    daya

  • What´s the best approach to work with Excel, csv files

    Hi gurus. I got a question for you. According to your experience what's the best approach to work with Excel or csv files that have to be uploaded through DataServices to you datawarehouse.
    Let's say your end-user, who is not a programmer, creates a group of 4 excel files with different calculations in a monthly basis, so they can generate a set of reports from their datawarehouse once the files have been uploaded to tables in your DWH. The calculations vary from month to month. The user doesn't have a front-end to upload the excel files directly to Data Services. The end user needs to keep a track of which person uploaded the files for a determined month.
    1. The end user should place their 4 excel files in a shared directory that will be seen by DataServices.
    2. DataServices will execute certain scheduled job that will read the four files and upload them to the Datawarehouse at a determined time, lets say at 9:00pm.
    It makes me wonder... what happens if the user needs to present their reports immediately so they can´t wait until 9:00pm.  Is it possible for the end user to execute some kind of action (out of the DataServices Environment) so DataServices "could know" that it has to process those files right now, instead of waiting for the night schedule?
    Is there a way that DS will track who was the person who uploaded those files?
    Would it be better to build a front-end for the end user so they can upload their four files directlyto the datawarehouse?
    Waiting for your comments to resolve this dilemma
    Best Regards
    Erika

    Hi,
    There are functions in DS that captures the input files automatically. You could use file_exists() or wait_for_file() option to do that. Schedule the job to run every certain minute and if the file exists then run. This could be done by using a certain file name with date and timestamp etc or after running move the old files to archive and DS wait for new files to show up.
    Check this - Selective Reading and Postprocessing - Enterprise Information Management - SCN Wiki
    Hope this helps.
    Arun

  • How to load Java properties file dynamically using weblogic server

    Hi,
    We are using Java properties file in Java code. Properties in java properties file are frequently modified. If I keep these properties file in project classpath or as part of war, I will have to redeploy application after each change.
    We are using Weblogic Server.
    Can you please suggest me how can this properties file be loaded at weblogic server startup. Then in that case, how to refer property file in Java code?
    What is the best practice for this?
    Thanks,
    Parshant

    Another alternative is, keep the property file in any pre-defined location. Write a class which reads the properties from the file and returns the one which is requested by caller and deploy this class. Whenever you have to change the properties just update the property file on server and next call to fetch the property should return the updated one.
    Downside of this approach is file I/O everytime. To overcome that you can actually "cache" the properties in a hashmap. Basically when any property if requested, first check the hashmap, if not found then only read from property file and also update in hash map. Next time same property will be returned from hash map itself. The hash map will be cleared at every server restart since its in the memory. You will also need to build a method to clear the hashmap when you update the values in the property file on server.
    This solution would be suitable for small size files and when network overhead of calling a DB needs to be avoided.

  • I need to change values in a file owned by root (root password is constant)

    The file is parameter file has below contents. The file is owned by root. My script is run by normal user and root password is constant and we can hardcode it.
    ABCLimit: 90
    SpoolLimit: 200
    TimeLimit: 345
    I need to change the value of SpooLimit from 200 to 400.
    Can anybody please give code for this?

    Your application needs to be running as root, or the user that started the application needs to have root level permissions for at least specific funtions (i.e. /etc/group, RBAC, sudo, etc).
    Java cannot change the users permission level in anyway that the user cannot already do himself.
    If you wish to find out how to use the /etc/group file, RBAC, sudo, etc, find your local System Administrator and explain your intentions to him/her (yeah, now that's a conversation I want to hear).

  • Changing values in drop-down dynamically

    Hi All,
    We have created a report to display certain data using object oriented ALV. In the display, drop-down help is provided for one column.
    Now, I want to vary the values in the dropdown help depending on certain criteria.
    Is it possible?
    Thanks,
    Supriya.

    HI,
    Please refer the program BCALV_EDIT_06.In one form set_drdn_table, Loop the table whose values you want to show in drop down,append and pass to method set_drop_down_table of ALV class.
    Hope this helps you
    Raj

  • CloverETL Default Properties File

    Hi, I have followed the instructions on Help - Eclipse to try and change the default properties file in the CloverETL engine. However, the changes do not seem to have taken any effect. Is there something I am missing out?

    Hi,
    If you want to modify default values for the whole CloverETL engine, you can modify defaultProperties file directly. The whole path of this file is mentioned in our documentation.
    But if you want to change some default values just for the current graph, you can create a new file with only those properties you need to override. Then name this file e.g. as modifiedProperties (without any suffix) and place it into project directory (i.e. right next to .project, .claspath and workspace.prm files of desired project). Open Run configuration of the graph, and fill -config modifiedProperties into Program Arguments text area.
    That is all. If you did it correctly, this line should be visible in graph run log:
    INFO  [main] - Loading Clover properties from file:modifiedProperties
    If this does not help you, please post also version of your software and version of CloverETL.
    Please, do not hesitate to ask if something was unclear.
    Best regards,
    Lubos Imriska
    CloverCARE Support
    Javlin a.s.

  • ServletContext Vs Properties file

    Dear Friends,
    My question is related to optimization.
    In our Servlet application, We have to read some values
    from properties files. In this which one is better from the following
    or is there any better way of doing?
    1. Reading from the Properties file everytime required. (So for each user the Properties file have to be accessed)
    or
    2. Reading from the Properties file once in the init method of the servlet and store those in the Servlet Context variables and use it whenever required.
    Please suggest me the best way.
    Thanks in advance.
    Regards,
    Goudham

    I think the best way would be to read the property
    file one time and store it as a hashtable and the last
    modified date, stored as a Long, should be stored up
    in a Hashtable, keyed on the filename. The Properties
    should be loaded from the file only if the last
    modified time in the Hashtable is less than the last
    modified time of the file, or if the filename isn't
    found. This insures that a modification check is done
    for each Properties file individually, and that they
    are all continually up to date. Also on server
    restart, all files are reloaded since they aren't
    initially listed in the Hashtable.
    Just a opinion
    -AsheeshThanks!
    If I understand correctly, Read the Properties file once and store the Key Value pairs in a Hashtable then maintain this Hashtable in ServletContext? Is this correct?
    - Goudham

  • How we write into properties file using get class method

    Hi
    I want to set some value into properties file using given code
    can any one please tell me how i can do this.
    property file
    setting.properties
    Name     =     abc
    and code I use is
    java.io.InputStream oInputStream = this.getClass().getResourceAsStream("Setting.properties");
                   Properties obj = new Properties();
                   obj.load(oInputStream);
                   String myName = obj.getProperty("Name");
                   System.out.println("myName :"+myName);
                   obj.setProperty("Name","def");
                   FileOutputStream oOutput= new FileOutputStream("Setting.properties");
                   obj.store(oOutput, "");
    thanks.

    You can't.
    If you have properties that change dynamically, you should not be using a properties file that sits in the classpath, you should be using Preferences, or a properties file that sits in some application or possibly even user directory, but not one in the classpath. The proper way to do this, would be to have a properties file in your jar (or otherwise in your classpath) that contains the defaults, and another one outside of the classpath in one of the twwo above mentioned areas, then, you read the default one only if the other doesn't exist, or you read the default one first, then read the other overwriting the values from the defaults.
    Don't forget to save the properties again (right after loading if you loaded, or always load, the defaults) after every change.

  • Externalize a properties file on a Websphere

    Hi Everyone,
    I hope im in the right forum.
    Can you please help me to externalize a property file on a Webshpere Server. I have an application in an EAR file, and I want to externalize its properties files, so that I dont have to redeploy the EAR file again if there are changes on the properties file. Thanks so much.
    Here is how I access it (inside an EAR file)
    +ResourceBundle rb = ResourceBundle.getBundle(applicationProperty);
    value = rb.getString(property);
    +
    How about outside? or an external?
    Thanks in advance!

    Can you please help me to externalize a property file on a Webshpere Server. You can put it wherever you want.
    I have an application in an EAR file, and I want to externalize its properties files, so that I dont have to redeploy the EAR file again if there are changes on the properties file. Thanks so much.You are mixing 2 ideas. The first is to externalize the properties file (which i may not fully understand what you mean). The second is to update the properties file without restart. To do this you'll have to have your app watch the file and when/if it changes you'll have to explicitly reload properties and reinitialize whatever you need to.

Maybe you are looking for

  • Install Oracle 8.1.7 on Sun 5.7 0899

    Can somebody help me with the following problem ? When installing Oracle 8.1.7 , i found the error message "Error in invoking target install of makefile /u01/app/product/817/plsal/lib/ins_plsql.mk" Does that error come from the swap space ? because i

  • How can I track a audiobook that i sent as a gift?

    I believe I sent audiobook as a gift to my sister in law but haven't gotten an email confirming the purchase.

  • CSS11503 Keepalive Script Issue

    I had an issue today where I sent my config via ftp to my CSS11503 (sg0810401) and on several of my keepalives I have a script configure to test connectivity for the LDAP ports.  At the time that I sent my config to my CSS i had not yet loaded the sc

  • Double trouble with video files...

    1) I can't watch any video stream unless I'm root. Here's the groups root resp. riwa are in. 075607/home/riwa/# groups root bin daemon sys adm disk wheel log audio optical 075724~$ groups video audio optical users 2) Also the video and sound lag terr

  • My iba files don't open with new ibook author

    I downloaded the new ibook author and my iba files won't open.  How do I open them?