Modifying property file at run time

Hi all..
I have been using properties file for handling few configurations in my project.
whenever i need a change in the file, i had to change it in corresponding file, create a jar file and then introspect it into project and then publish the project.
Is there any other way of achieving it.... can we modify the property file at run time just like we do for JSP pages...
Or any other better way of doing this.. pls suggest..
(am using 10g OBPM)
Have a nice time...
Regds,
Viswanath

Sharma,
write a java class that reads a property file from the external path. make the jar file non-versionable in case you need to update that later. if you are on J2ee container all you need to do it drop the file @ domain root and u shd be good to go.
sample code I am doing this for log4j.properties and application propertied.
public class BPMLoggerUtil {
     // Initializing the default Logger //
     private static Logger logger = null;
     private static final String DEFAULT_PATH = "resources/log4j.properties";
     private static HashMap map = new HashMap();
     * This is the init method
     * @param propertyPath
     public static void init(String propertyPath){
          try {
               if((logger = (Logger) map.get(propertyPath)) == null){
                    Properties properties = new Properties();
                    properties.load(LoggerUtil.class.getClassLoader().getResourceAsStream(propertyPath));
                    PropertyConfigurator.configure(properties);
                    logger = Logger.getLogger(PropertiesHelper.getProperty("resources.test", "AppName"));
                    map.put(propertyPath, logger);
          } catch(Exception ex) {
               ex.printStackTrace();
     }

Similar Messages

  • How to get info from a .class file at run time? thanks for help

    I need to get methods and properties (variables) from a .class file at run time.
    as u know, javap.exe can do that in an independent way. but i need to get info at run time once the .class or packeges have been changed, javap is not suitable in the case.
    i try to read data directly from .class file but it's hard to know the file format.
    e.g. a class looks like (java file):
    class MyClass extends Frame
    int i0;
    String s0;
    public String getName()
    if the file is compiled to .class file, how to get properties (variables: i0,s0) and methods String getName() from the .class file by an applicaton at run time?
    Doclet is not suitable for speed reason, it is too slow to get right info in right format.
    Thanks for any help, please write a little bit more in detail if you know.

    Use the Java Reflection API. Have a look at the Reflection section of the Java Tutorial located at http://java.sun.com/docs/books/tutorial/reflect/index.html

  • Convert standard video files in to flv file at run time

    Hello All
    How can we convert standard video files in to flv file at run
    time like
    you tube and
    Google Video is there any
    script or tool to do this. This is urgent.
    I have one project in this project client requiring function
    like whatever standard video file he upload, it will be play in
    .flv formate
    Any help is appreciated
    Naved Ansari

    I think you need the Macromedia Flash Media Server to be able
    to do what you are asking. Flash 8 can with a Flash Video Encoder
    but it does not do it on the fly. There maybe other 3rd party
    servers that you can sign-up that allow you do this but if you are
    looking for your own solution you will need the FMS 2.0.
    Tim

  • Opening Another Flash File during Run Time

    I know, this is too easy. How do I open a Flash.exe file
    during run time? I know the code below is wrong but some insert the
    correction?
    open_btn.onRelease = function () {
    play("C:\Documents and Settings\GameOfficeFlow.exe");}
    Forever in your debt,
    Mike

    play() is a timeline command.
    I don't think you can have Flash load/play an exe file, but
    wait awhile and see if someone else knows better on that one. You
    can have it load/play an swf version of a Flash file though.

  • How create bath file in run time in java

    Hi all
    i run one bath file by using process class but i create bath file in run time in java .please help me with code.

    Dynamically Writing a batch file in Java is exactly the same as writing to a simple text file.... you just give it the file extension ".bat".
    If you can't write to a simple text file yet, you should probably buy a Java book and start working through it.
    regards,
    Owen

  • Set value TextTemplatingFileGenerator to custom tool property of a t4 template file at run time(programmatically) in an MVC Project

    In Solution Explorer we can set the Custom Tool property for a t4 Template file in the Properties window. But can anybody help me doing the same at run time?
    I want to assign the value TextTemplatingFileGenerator programmatically to the Custom Tool Property.
    Thanks in advance...

    Hi suraya,
    Since the issue regards MVC and website deployment. I suggestion you post the question in the ASP.NET forums at
    http://forums.asp.net/. It is appropriate and more experts will assist you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is it possible to modify a view at run time?

    Hi,
    I am relatively new to using SQL Server, so sorry if this is impossible or very easy and I missed the solution.
    I am working on an enterprise SQL Server 2008 R2.  Because of the size of the company, we do not want to create new Views as they need to be maintained.  With that said, I need to use Views and not tables because of DB traffic issues.
    HERE IS MY QUESTION:
    Is it possible to Alter a view at run time; in this specific instance I want to change a constraint in the WHERE clause to include one more value in an IN() constraint.  Specifically I want the modified SQL to go from WHERE column IN('A', 'B', 'C')
    to 
    WHERE column IN('A', 'B', 'C', 'L').  I do not want to permanently modify the View, I just want the View to change when it is run for this report.  I need to do this in order to fix a dynamic report.  I am sure that there is another way to
    accomplish this; however, a solution of this manner would also have many other uses, so I am curious if this is possible. 
    Feel free to tell me that it can be done. 
    Thanks for your ideas!!

    Right, I understand those fundamentals.  We outsource a lot of out view creation and do not have permission to create views for Business reasons; these are beyond my control.  However, I can see the source code to many Views.  We have also
    been told that we should not use tables in our queries.  Therefore, I need to use existing Views.  Specifically, I would like to add an additional value to an IN() constraint.  This would change the constraint as showed below: 
    IN('A', 'B', 'C') ---> IN('A',
    'B', 'C', 'L')
    I am wondering if this change can be made when the view runs and only for this one report, with the change being made from the report.  This would be very easy if the constraint was removing a value.  Obviously I could change the constraint from
    IN('A', 'B', 'C') to IN('A','B') very easily with out modifying the View. This would be done by writing a query against the view and in the WHERE clause adding the new IN('A', 'B') statement.  However, I want to do the opposite and add a value...

  • Can i change my contain in file at run time

    hello everybody,
    i am beginner and i am trying to write the online test,
    i display users to login and then display first question on question.html,
    now my question is can i change question and send next question at run time on same question.html
    please reply me,
    waiting for answer

    hello,
    but how i open that html files and change the contain within control (say textbox) as i change the question in text box.
    please reply me

  • Problem in writing Hindi Font in properties file at run time.!

    hi,
    We are using Language translator for our project.
    We are able to convert the language in hindi and chinese language.
    Im also creating properties file respective to each page in hindi,english and chinese language.
    At run time while CREATING properties file shows the english font appropriate but while
    in hindi it shows problem at run time .
    after WRITING at run time the hindi properties file contains lots on question mark(????????????) intead of hindi font words.
    does any advise me the solution to this problem.?
    Thankx in advance.!
    Johnita

    Hi suraya,
    Since the issue regards MVC and website deployment. I suggestion you post the question in the ASP.NET forums at
    http://forums.asp.net/. It is appropriate and more experts will assist you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Missing vi.lib files in Run-Time LabVIEW 2012

    Hi
    I've got a problem executing VI's under RT in LabVIEW 2012.
    Our system consist of multiple independent modules which are opened and run from a Manager VI. VI paths to the modules are read from an .ini file by the Manager VI.
    We have build a single executable (RT Launcher) that takes the path of the Manager VI as argument (Attachment : RT Launcher.png).
    The RT Launcher is placed in the ..\National Instruments\LabVIEW 2012 folder as the LabVIEW.exe.
    The RT Launcher is called from the CLI.
    "C:\Program Files\National Instruments\LabVIEW 2012\RT Launcher.exe" "C:\Workspace\Labview\Manager.vi"
    This will run the Manager.vi in the RunTime Environment and the Manager.vi will open the .ini file and execute the Module VI's one by one.
    By calling the RT Launcher.exe from the same folder as the LabVIEW.exe, the search paths should be the same.
    The system worked fine in LabVIEW 2010.
    The Manager VI is opened with broken arrow and the errors indicate that vi.lib sub VIs are missing (attachment : Manager VI errors.png)
    I know there are issues regarding object cache and separated compiled code from LV2010 -> LV2011 -> LV2012, but simply can't figure out how to come around this problem.
    Can anyone explain the difference and how to solve the problem ?
    Thanks
    Regards Kahr
    Certified LabVIEW Architect
    CIM A/S
    Solved!
    Go to Solution.
    Attachments:
    RT Launcher.png ‏68 KB
    Manager VI errors.png ‏35 KB

    Hi Kahr.
    It sounds like you are making some dynamic calls to VI's, eg. by using 'Open VI Reference'. My answer is based on that assumption. 
    You are absolutely right. In LabVIEW2010 we introduced a function called 'Separating Compiled Code from VI'. At that time none of the VIs from VI.lib had that option enabled. In LabVIEW2011, many VI's in VI.lib have, by default, a separation of compiled code and VI. This option cannot be changed (greyed out) for these VI's as well. This feature was introduced in order to simplify source code control.
    Separating Compiled Code from VIs and Other File Types
    The drawback is, that it is no longer possible to call VI's dynamically from an application (executable), when this option in enabled, since the compiled code no longer exists. The method of calling a VI dynamically from an application has been (and still is) used to make some kind of a plug-and-play architecture, meaning we have one EXE-file that only gets distributed once and a set of subVI's that gets redistributed according to new versions (new features added to the subVI), meaning we can make changes in the subVI without having to redistribute the EXE-file.
    With the release of LabVIEW2011 and LabVIEW2012 we can no longer distribute VI's that uses functions from vi.lib, this also include DAQmx calls even though the DAQmx driver is installed.
    The simple explaining is, that it has never been intended that VI's got distributed. Eg, when Microsoft is making a new software update for Windows7, they don't send out the source code to all the users.
    The solution is therefore to wrap up the source code into 'something' that includes all the compiled files. In LabVIEW we do that in a couple of different ways.
    1) Include the VI's in the EXE-file.
    When building the application, we have the option to include files, that normally is not included in builds. If we call a SubVI dynamically this will not automatically be included! However, the drawback of this method is, that if you need to change  something in one of your SubVI's, you would need to build and distribute the entire application. Thereby, we are not making use of the plug-and-play architecture that we originally wanted. However, this method will fix the error.
    Error 1003 When Using VI Server in a LabVIEW Application
    2) Now, if we still want the plug-and-play architecture in LabVIEW2011+2012 (and this will properly be the same for the next many released of LabVIEW), this can still easily be achieved by making a Source Distribution. When we make a Source Distribution, we can include the VI's from VI.lib and thereby the compiled code. When using this method, two important things should be remembered:
    a) Make the files into a LLB file. This will pack all the VI's into one single file, that is easy to distribute.
    Go to Destinations ==> Destination Type ==> LLB.
    b) Make sure not to 'Exclude files from vi.lib', as this method will then simply not work.
    Go to Additional Exclusions ==> Remove checker mark in 'Exclude files from vi.lib'.
    How Can I Call a VI Dynamically from an Executable Without Including Those VIs in the Build?
    I have made a small example to demonstrate this:
    Example: Using vi.lib
    This example has two mainVIs and two EXE-applications. Build the two EXE-files, but do NOT build the source distribution yet.
    1) Main(IncludeSubInExE). This version has included the subVI in the build distribution for the EXE-file. When running this EXE everything works fine, even when calling the subVI dynamically. However, since the subVI is build into the exe, we would have to redistribute the exe for every new version of the subVI. This breaks the hole idea.
    2) Main. The subVI is no longer included in the build. When running and trying to call the subVI, you will get this error (on both your developer and run-time machine):
    Now, build the Source Distribution and run this EXE again. The exe is running perfectly with no errors.
    I hope this answers your question.
    Best Regards
    Alex E. Petersen
    Certified LabVIEW Developer (CLD)
    Application Engineer
    Image House PantoInspect
    Attachments:
    Using vi.lib.zip ‏83 KB

  • Error when importing static files in run-time installation

    Hello all,
    I have a development environment running 3.2 and also a run-time test environment running 3.2. I'm trying to import an export of static files from the development environment into the test environment, and we're getting the following:
    SQL> @static_file.sql
    Set Credentials...
    Check Compatibility...
    API Last Extended:20090112
    Your Current Version:20090112
    This import is compatible with version: 20090112
    COMPATIBLE (You should be able to run this import without issues.)
    Set Application ID...
    ...static file repository
    declare
    ERROR at line 1:
    ORA-00001: unique constraint (APEX_030200.WWV_FLOW_HTML_REPO_IDX1) violated
    ORA-06512: at "APEX_030200.WWV_FLOW_HTML_API_PRIVATE", line 84
    ORA-06512: at "APEX_030200.WWV_FLOW_HTML_API", line 45
    ORA-06512: at line 6
    We've exported and imported these same static files in the past with no issues, and we also exported and imported two applications and an image export without issues.
    Any idea what is causing this?
    Thanks!
    John

    Update:
    I had two static files in my export - one was assigned to a specific application and one wasn't. When I ran into the issue importing, I had elected to export "all static files". I just tried it again, but exported and imported each of them individually, and it worked fine so I'm back in business.
    But perhaps there is an issue when exporting all files, when they aren't all assigned the same way? Maybe something to be looked into...
    John

  • Modify chart options at run time?

    Post Author: davestewart
    CA Forum: .NET
    I am trying to create a bar chart that shows a custom grid line, or a reference line across the chart. I can set this manually in chart options using the 'Draw custom line at:' setting in the grids tab of the data axis in chart options. There must be a way to set this programatically at run time as this value will change based on the dataset passed to teh report each time. How could I accomplish this report?
    If there is some other way to show a horizontal reference line on my bar chart, and have it match up with the scaling, that would be fine too. Any method of getting this on there would be great.
    Thanks for any help you may be able to lend!

    Hi ,
    this will work..ut after you enter the p1 , you atleast have to hit enter key to get the value automatically in p2.
    this is because you have to have atleast one screen refresh.
    handle the eventy at selection screen output....
    this is called just before the screen is dispalyed.
    may be something like this.
    p_matnr  material
    p_maktx  description of material
    But the value will not appear as soon as you enter the p1 , you have to..
    1)enter p1
    2)press enter
    3)now p2 will appear automatically since at selection screen output would have processed in between.
    AT SELECTION-SCREEN OUTPUT.
      IF NOT p_matnr IS INITIAL.
        SELECT SINGLE
        maktx FROM makt INTO p_maktx WHERE matnr = p_matnr AND spras = 'EN'.
      ENDIF.
    please reward if useful.
    Edited by: santosh sarda on Mar 8, 2008 11:51 AM

  • Is there any way I could generate CAB (M$ stuff) files at run time?

    Hi,
    I was wondering if there is any way I could be using to generate a CAB file at runtime. Sure, it has to be a Java Class or Library.
    The goal is to set some files in the configuration settings and then sending this CAB to a Windows Mobile powered device.
    I have been googling for such a thing, but had no joy.
    Does anyone have any idea?
    Cheers

    Create a zip and rename it to .cab. - that's what half of the cab files around are.
    (not a serious suggestion, but there are at least four different CAB file formats, zip included, some used in Microsoft official products, others in common products that run on Windows like Install Shield, and you need to find out what whatever is going to read it expects to be in the-file-that-happens-to-end-in-CAB before you can look for code to write it)
    (which reminds me of a web content filter at one company I used to work out which blocked all URLs which ended in CAB, so every now and again you'd get blocked from sites which used hex session keys in their URLs)

  • Add files in run time to the vedio player

    I have created a vedio player where in u can add upto 10
    flv's in a series in the folder and they will be played. How can i
    have a browse button which will add the files list dynamically in
    the player?

    Thank you for keeping eye on it - points assigned.
    It is only that we already implemented the note 1087841 - Old Web Template versions displayed in cluster installation, but the problem we face is that the note discusses "J2EE cluster installation", while we see the issue appearing in one node system
    Regards,
    -Vitaliy

  • Appending in file and supplying file name at run time using File Adapter

    Hi,
    Can we use File Adapter to write in a file in append mode. i.e. a BPEL process opening a file appending some text and closing the file each time it called.
    Another query is can we create the file at run time with the supplied file name?

    In order to append to a file, we can use Append="true" in the interaction spec for the File/Ftp adapter.
    <jca:operation
    FileType="ascii"
    PhysicalDirectory="/home/adapter/output"
    FileNamingConvention="OutputFile.txt"
    NumberMessages="1"
    Append="true"
    >
    Filename we can specify in wsdl...

Maybe you are looking for

  • VC 7.0 integration with BW 3.5

    Hello, Is it possible to model BI data service in VC 7.0 and pass variables to the BW query dynamically based on user parameters ? In other words, we have defined a query in BW 3.5 with a variable (e.g. costcenter). Can we populate the costcenter val

  • Questions on scanning negatives?

    I thought I'd post a new thread, as had some remaining questions and didn't want to hijack someone else's thread. I'm embarking on scanning in all my previous 35mm colour negatives, and have so far learnt quite a lot both from experimentation and fro

  • How do I get the os on a new hard drive?

    optical drive doesn't work, hard drive crashed. how do I get the os on a new hard drive?

  • Edge detection between the finiteelement mesh and a bounding box

    i have an finite element mesh ,i constucuted a bounding box which passes through the mesh ,so now i want to detect the edge of the rectangle which intersects the mesh and construct a new mesh which resides in the rectangular box.how to do this.any ki

  • Copying two layers through same selection mask produces different dimensions on new file

    Hi all, This is driving me insane! I'm creating an animation in AE eventually but initially have two hand drawn images of the same object that I've scanned into PS. I have a single mask created that I turn into a selection to copy the two images to o