Reloading the Properties form config file

the doubt is on reloading the properties without restarting the server...
Earlier, I have a PropertyReader class which loads the properties from config file, here is the process I followed.
1)Calling the getInstance() from out side, which test the local instance variable exist or not, if it exists, then skip the creating new instance, else create the object by calling the self Constructor. Here is the method
   public static PropertyReader getInstance(String fileName) throws IOException{
        if (instance==null){
            try {
                instance = new PropertyReader(fileName);
            } catch (IOException e) {
                throw e;
        return instance;
    }2) In the Constructor, I read the properties from the property file like the following.
    Properties props = new Properties();
    InputStream fileIn = null;
    fileIn = getClass().getResourceAsStream("/" + "ldap.properties");
    props.load(fileIn);In this scenario I can't access the modified properties until I restart the server.
Now, I came to change the code to reload the properties with the following scenario.
1) in my getInstance method, I skip checking the instance and just calling new objct every time.
   public static PropertyReader getInstance(String fileName) throws IOException{
        return new PropertyReader(fileName);
    }2) Even after this, I can't access the latest properties, then I change the code in the Constructor like the following .
       URL codebase = getClass().getProtectionDomain().getCodeSource().getLocation();
            String subPath = codebase.getPath().substring(0, codebase.getPath().indexOf("WEB-INF")+16);
            file = new java.io.File(subPath+"ldap.properties");
            fileIn = new FileInputStream(file);
            props.load(fileIn);Here it is, now I'll be able to get the latest properties even without restarting the server.
So here I got couple of questions.
1) What if I create new instace everytime, will that cause any trouble in the memory point-of-view? i.e. load trouble?
2) What is the difference between 2 nd step in each scenario ? I can't get the exact difference.
Thanks,
Sumant K
Edited by: sumant14 on Jun 4, 2009 6:47 PM

sumant14 wrote:
So here I got couple of questions.
1) What if I create new instace everytime, will that cause any trouble in the memory point-of-view? i.e. load trouble?If you create just ONE object occasionally? Don't waste your time worrying about that. Unless you're doing this thousands of times each second.
2) What is the difference between 2 nd step in each scenario ? I can't get the exact difference.The first one just gets the properties file from the classpath. The second one is a bizarre hack which might do the same thing, or it might fail in certain circumstances.

Similar Messages

  • Reloading the Web Form....

    I am able to run Oracle Forms 5.0(Dev 2.1) on the web with
    JInitiator. But I have observed one thing.
    - When I'm done with the form, I click on the menu,
    'Action' and then 'Exit'. This brings me back to
    the browser. When I tried clicking 'REFRESH' on
    the browser, the Form never comes out again. I
    still have to close down the browser and open it up
    again and call my web form.
    Is this a normat behavior? Is there another way I can reload
    the web form without exiting the browser?
    Thanks,
    Chris
    null

    sumant14 wrote:
    So here I got couple of questions.
    1) What if I create new instace everytime, will that cause any trouble in the memory point-of-view? i.e. load trouble?If you create just ONE object occasionally? Don't waste your time worrying about that. Unless you're doing this thousands of times each second.
    2) What is the difference between 2 nd step in each scenario ? I can't get the exact difference.The first one just gets the properties file from the classpath. The second one is a bizarre hack which might do the same thing, or it might fail in certain circumstances.

  • How to hide password in forms config file

    Hi
    Is there a way to hide the password in the forms config file?
    Regards,
    Néstor Boscán

    Hi,
    you cannot. For a future version we are condering password indirection, which is a feature of OC4J. However, until then the option to use is to implement Single Sign-On with Forms as this storeds username and password in OID
    Frank

  • How can I access the properties of Microsoft files (excel, ppt, and word)

    Hi,
    How can I access the properties of common Microsoft file formats (Excel, Word, and Powerpoint) from a Java program. You can access/modify the properties of each document type using File->Properties in each MS application. The properties are essentially name/value pairs.
    Basically, I need to write a java program that scans a directory and accesses the properties in each of the MS files in the directory.
    thanks,
    -john

    By api. That is only way to establish a contract with the MS programs you want to interface with, unless you write an api yourself! I've used POI and it was an awesome way to use Excel in java. I created an excel spreadsheet from the results of a sql query from a batch program and then it was automatically emailed using javamail to my client. I had a lot of VBA experience with Excel, Word, and Outlook and it didn't take me long to get used to using Jakarta-POI.
    Now I see there is Jakarta-POI-HWPF which works with MS Word documents. Go to: http://jakarta.apache.org/poi/

  • File explorer (windows 8) doesn't show the properties of pdf files such a keywords or tittle. Neither when click on second button. I just see them when the file is opened with adobe reader (file prperties)

    I attach some picture to show the problem.
    Im sorry because the os is in spanish, so i translate for you the fileds names shown
    etiquetas means tags or keywords or labels, as you can see in the first picture at the second row, some file (office pack) show the tags but the selected one doesn't (pdf).
    propiedades means properties. The properties shown are different if I opened from file explorer to acrobat.
    I think there is a compatibility problem with the xmp file (metadata) from pdf file ans windows 8.1 (64bits). I tried to solve it by installing a missing file called ifilter, but the problem continues

    I believe this is all normal.

  • HT201272 I lost all my files after dowloading Icloud and updating Itunes on 24 September 13.  having reloaded the computer and and files from an Emergency Backup folder I can no longer see My Library in Itunes or in Itunes store, and my ipod and ipad aren

    can anyone help with retrieving My Library in Itunes and Itunes store - having updated Itunes and Icloud on 24 September 13, my computer failed and I lost all my files which were eventually backed up to an Emergency Backup.  my computer is now working again and I have down loaded Itunes and transferred all the files from my Emergency Backup.  Non of the music went back into Itunes, so I had to find these files and manually moved them to Itunes.  The music is now in Itunes, but I no longer have the folder named My Library, which I think is the reason my Ipad, ipod no longer sync any additional music I have added to Itunes. Does anyone know how to rectify this please.
    Many thanks.  Crusey

    iTunes expects files and folders to be in very specific locations.  When you start iTunes it looks for a file called library.itl which is in the iTunes folder.  It then uses all the references in that file which tell it where all your media files are located to build up the view you normally see.  Probably you moved the library file so iTunes cannot find it and it will make a default one which is empty.  When you plug in your iPod it isn't recognizing the library since it is not the same one to which you synced last.
    Simply put, you need to undo all your file moves.  Not as eaily done as stated but since I cannot quite see from here exactly what you spent an hour doing last night it will be up to you.  Did you make a backup before doing all this?
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605

  • Using system properties in config file.

    HI,
    Does anybody know how we can declare System properties in OC4J.
    I am talking about using System.getProperty() in java classes.
    I need to use this to capture my context realtive path in log4j properties file.

    JavaSiva,
    If you are using OC4J stand-alone, there are two ways (I know of) to define "System" properties:
    * Use "-D" option of "java" command when launching OC4J
    * Use "-p" switch recognized by "oc4j.jar" when launching OC4J
    Note that I haven't tried OC4J stand-alone developer's preview 10.1.3.1.0 so I don't know if the above is still correct for that version, but it is for every version prior to that one.
    Good Luck,
    Avi.

  • UWL - I want to add the column "item type" in the UWL XML config file

    Hi,
    when personalizing a view in the default UWL iView, a user can add the column "Item Type", which shows the icon of the corresponding item.
    I want to add this column to a default view configuration in the XML file, so that all users have this column available by default. I guess the right attribute to do so would be the "columnOrder" attribute of a view. I tried to add the value itemType and objectType, but none of this worked, the column did not appear.
    From help.sap.com at
    http://help.sap.com/saphelp_nw70/helpdata/en/39/a1bb5c4c0d4ab4a417e87ef35f1efa/frameset.htm
    I found some attributes and I tried statusIcon, externalId and externalType. statusIcon does not show the item type icons and the other two don't work at all. The table shows that they have the attribute "Visible to user = NO".
    Does anybody know the correct value which I have to add to the columnOrder attribute or how I have to configure the XML file?
    Thanks a lot for any help,
    Fabian

    I found it myself, it's the attribute "itemTypeIcon" which has to be added to the columnOrder attribute.

  • I loose text of emails randomly; I have tried the properties and fix file procedure, but will not work;

    I use W7 and TB 31.2; when I sign on to Comcast.net, all message text is fine; if I forward the Comcast emails that failed on TB they then come through fine on TB with all the text; Should I reload TB? Would I loose my emails?

    https://discussions.apple.com/docs/DOC-6131

  • Deploy a package in SSIS DB catalog and pass Config file dynamically in a SQL job

    Hi,
    I have a Package that needs to be deployed in SSIS Catalog DB.
    Later I need to execute it through SQL Job.
    Please let me know the steps how to do this and also I need to pass a Config file to run the package in SQL job.
    Thanks,.
    Sailaja

    Hi Sailaja,
    Based on your description, you want to deploy a package to SSIS Catalog DB, then execute it through SQL Agent job with configuration file.
    To deploy a package to SSIS Catalog DB, we can refer to the following suggestions:
    SSMS-->Integration Service Catalogs-->SSISDB-->Your project-->projects. Right click on the projects, and choose "Import Packages...". Then make use of the Project Conversion Wizard to select the packages that you want to deploy, deploy
    the generated .ispac file to SSIS Catalog. For more details, please see:
    https://msdn.microsoft.com/en-us/library/jj852096.aspx
    The command line tool DTUTIL.EXE which can be used to deploy SSIS packages. For more details, please see:
    http://www.mssqltips.com/sqlservertutorial/215/command-line-deployment-tool-for-ssis-packages/
    To schedule the package by using SQL Agent job, we should select Integration Services Package for the job step type, then add configuration file or add some properties form configuration file in the Configuration tab. For more details, please see:
    https://msdn.microsoft.com/en-us/library/gg471507.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How can I use my log4j config file of my web project in ias?

    I used log4j in my web project. So I put a config file "log4j.properties" in my project WEB-INF/classes/.
    It works well in tomcat. But when I deploy it to ias parent by orabpel project, It didn't work know!
    I can only see my log in "$ORACLE_HOME/opmn/logs", and some message I nedd is losed, such as the class name, line,datetime, Thread and so on.
    I think the config file of my project is't work, maybe log4j use some config file of ias but me.thx
    So where is the log4j config file of ias, can i modify it ?
    Or how can I let my project use my config file not ias? Any one can help me, thx!

    If you are wondering if/how to control the log messages coming from bpel, here is the corresponding log4j config file that it uses:
    $ORACLE_HOME/bpel/domains/<DOMAIN_NAME>/config/log4j-config.xml

  • Search for a specific string in web.config file

    Hi
    Is there a way we can search a specific word in web.config using powershell.
    I have an entry of "user name" in the connection string. I want to find what the user name is and whether its a correct user name or not based on the criteria set in the script.
    i believe its a simple matter of if statement but due to connection string i am unable to do this.
    this is my connection string from web.config
        <connectionStrings>
        <add name="Membership" connectionString="Data Source=testdb;Initial Catalog=test;user   
        name=testUser;password=123456;MultipleActiveResultSets=true" 
        providerName="System.Data.SqlClient"/>
        </connectionStrings>
    My criteria is. if user name -eq testUser write-host "correct user name" else "user name is incorrect"
    This is the script which i am using
        $webConfig = 'C:\Users\test\web.config'
        $cfg = [xml](gc $webConfig)
    Not sure how the if statement will work in searching the document and applying critera

    Here is the full web.config file. i just modified the credentials.
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,
    EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
        <sectionGroup name="common">
          <section name="logging" type="Common.Logging.ConfigurationSectionHandler,
    Common.Logging" />
        </sectionGroup>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468
    -->
      </configSections>
      <connectionStrings>
        <add name="Membership" connectionString="Data Source=TestDB;Initial Catalog=Test;user
    id=TestUser;password=1234556;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />
        <add name="Administrator" connectionString="Data Source=TestDB;Initial Catalog=Test;user
    id=TestUser;password=1234556;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />
      </connectionStrings>
       <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
      </startup>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory,
    EntityFramework" />
      </entityFramework>
      <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    throwExceptions="true">
      <targets>
           <target name="f1" xsi:type="File" fileName="test.log.txt"
    layout="${threadname} ${longdate}
         ${callsite} ${logger}[${level}] ${message}" />
           <target name="console" xsi:type="Console" layout="${threadname}
    ${longdate} ${callsite}
         ${logger}[${level}] ${message}" />
         </targets>
     <rules>
          <!--<logger name="Quartz.*" level="Warn" />-->
          <logger name="*" writeTo="f1" minlevel="Info" />
          <logger name="*" writeTo="console" minlevel="Debug"
    />
        </rules>
      </nlog>
      <common>
        <logging>
          <factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20">
            <arg key="configType" value="INLINE" />
          </factoryAdapter>
        </logging>
      </common>
      <appSettings>
       <add key="V3Import.Import.TestMode" value="true" />
        <add key="MSMQ.QueueName" value="TestQueue" />
        <add key="MSMQ.ErrorQueueName" value="TestQueue" />
        <add key="AdminSignaturePath" value="C:\user\test\myfolder" />
        <add key="SyncQueueJobCRON" value="0 0/2 * 1/1 * ? *" />
      </appSettings>
      <system.web>
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login" timeout="5000000" />
        </authentication>
        <membership defaultProvider="AspNetMembershipProvider">
          <providers>
            <add connectionStringName="Membership" enablePasswordRetrieval="false"
    enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="/Test" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="AspNetMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </providers>
        </membership>
        <profile>
          <providers>
            <add name="AspNetProfileProvider" connectionStringName="Membership"
    applicationName="/Test" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </providers>
        </profile>
        <roleManager>
          <providers>
            <add name="AspNetRoleProvider" connectionStringName="Membership"
    applicationName="/Test" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </providers>
        </roleManager>
      </system.web>
      <system.net>
      </system.net>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="dotless.Core" publicKeyToken="96b446c9e63eae34"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.3.1.0" newVersion="1.3.1.0"
    />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"
    />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"
    />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"
    />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0"
    />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"
    culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"
    />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

  • Refresh/reload the data of a particular sector/subform/object

    Hey,
    I've searched the forum for performance optimization, but I found only hints why a form may be slow.
    For example, a lot of data in drop down boxes or inactive caching on server side......
    But that doesn't help me really.
    Is it possible not to reload the whole form?  For example, to reload the data of a subform or a  single table.
    In this Threada: [Hiring Adobe Form-Performance problem]
    its a similar question, but I think it was not really answered if it works.
    It was only dissuaded him from this....
    Regards Florian

    Hello,
    in the latest releases the form is regenareted completely upon actions. There is only an XML data transmission to the server, and it returns an "update xml" what is merged into the PDF file by the reader.
    In older releases unfortunatelly the form is always regenerated from the data and template.
    Best regards,
    Dezso

  • How to deploy custom jar (forms PJC)  file in R12.1.x

    Hi ,
    we need use forms pjc connecting to client pc'com port with ebs form,
    we can deploy with ias standard form server , but EBS 's appsweb.cfg
    was automatically generated by AutoConfig , so i don't know how to config our jar in EBS env.
    i had search document in metalink for serval days , can some help us to solve this problem !
    thanks for any help...
    BR,Nolem

    Hi all, I am confronted by the same problem.
    I have manually added my custom Jar files to the archive=2 section of the appsweb.cfg config file in the $INST_TOP/ora/10.1.2/forms/server and placed the Jar files in the $COMMON_TOP/java/classes/oracle/apps/fnd/jar.
    I know that this is probably not the way to go, as autoconfig will override these settings, but my first priority is getting these jar files to run in Apps Forms without errors. I got as far as that my forms don't error out anymore but not all of them are working as they should. I am also trying to deploy the WebUitl utility in EBS R12. As far as I can tell this should be supported by Oracle as it comes as part of a standard Apps Installation (except for the Jacob.jar) it can be found in: $ORACLE_HOME/forms/webutil directory and the WEBUTIL_CONFIG reference to the webutil.cfg file can be found in the default.env in the same directory as the appsweb.cfg.
    If you want to look at some very good examples of PJC's there is a very good blog: http://forms.pjc.bean.over-blog.com/. You can also look at Francois Degrelle's blog on Read/Write files on the client machine without Webutil.
    Nevertheless information on how to deploy and run these PJC's under EBS is scarce. Metalink offers no solutions except very outdated notes.
    I would appreciate to know how to properly deploy these jar files in EBS
    I am also on 12.1.x. Btw there are more threads on this subject on OTN but most are outdated (threadID=1067917, 686329, 4246525) and don't provide the solution for EBS R12.1.x.
    Any help would be appreciated.

  • The IRS forms in .pdf format do not open, but they open on IE.

    Nothing except a new tab opens when I try to open any tax form from IRS site.

    I'm using Windows 8, MSIE 8, and I have Adobe Acrobat PRO 9 installed on my machine, but when I open the document on my hard drive it opens with bookmarks showing on the left.  When I go to the URL where I posted the very same document on the Web in my browser it opens the doc in the browser add-in and the bookmarks do not appear.  I have also tried using #pagemode=Bookmarks which does nothing for me.  Lastly, I can go to other documents on the Web that do work such as:  http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf which seems to open just fine with bookmarks showing in the browser view of the .pdf.   I compared all the properties of my file with a saved version of this example .pdf above and they are identical.  No idea why it is doing it... it's very frustrating though and I know others have posted the same issue all over the net.
    Does that help?

Maybe you are looking for

  • Can you put the sim card in without the tray on the iPhone 3GS?

    Can you put the sim card in without the tray on the iPhone 3GS? I don't have the tray, I have ordered a new one but would like to still use my iphone for the next few weeks

  • How to set default value and after that , use it as control

    Hello, Currently i am making motor driver from labview, and i am facing one problem. When i connect to my board via labview, it will relay last position to global variable. After that, i have to go to loop, where i can send back  modified position to

  • Soap receiver - owerwrite default http header fields

    Hi, I'm using the soap receiver adapter in nosoap mode. How can I owerwrite the default settings for the header fields in the http request? The soap adapter will automatically set content-type = application/xml. I would like for example set "text/xml

  • I Cant find My Apple Ipod!!

    About a Week Ago i noticed that i coulndnt find my Apple IPhone.  So i tried tracking it onn Icloud.com and  it keeps saying : Offline but what does that mean i also didnt leave the house so it is in here but i need help and apple can you help me tra

  • FORALL insert error

    Hi, I am using 10g. I am inserting emp table records into emp_temp table using FORALL, i am getting some implementation restriction error while doing this. DECLARE CURSOR EMP_CUR IS SELECT * FROM EMP; TYPE TAB_EMP_CUR IS TABLE OF EMP%ROWTYPE; V_TAB T