Reusing key in properties file

I want to do something like;
file.environment=D
file.name.incoming=${file.environment}this.txt
file.name.outgoing=${file.environment}that.txtI presume this is not possible to do this in java.util.properties. Is there a package that does this? Or should I just override load() and search/replace the values?

* PropertyResolver.java
* Created on 1 December 2006, 09:45
* Copyright (c) Esmond Pitt, 2006, 2008. All rights reserved.
* Permission is hereby granted for non-commercial use provided this copyright notice is preserved.
import java.util.Enumeration;
import java.util.Properties;
import java.util.Stack;
* ResolvedProperties scans a string and substitutes properties named
* by the syntax ${propertyname} by their values.
* Example: ${user.dir} is replaced by Properties.getProperty("user.dir")
* @author Esmond Pitt
* @version $Revision: 3 $
public class ResolvedProperties extends Properties
      * Creates a new instance of ResolvedProperties using System.getProperties.
     public ResolvedProperties()
     public ResolvedProperties(Properties defaults)
          super(defaults);
     @Override
     public String     getProperty(String name)
          String     value = super.getProperty(name);
          return value != null ? resolve(value) : null;
     @Override
     public String     getProperty(String name, String defaultValue)
          // Note that this must call this.getProperty(String name),
          // not the other way around, as that's what the superclass does.
          // Otherwise you get a stack overflow.
          String     value = getProperty(name);
          return value != null ? value : defaultValue;
     public String resolve(String string)
          StringBuffer     sb = new StringBuffer();
          Stack<StringBuffer>     stack = new Stack<StringBuffer>();
          for(int i=0; i < string.length(); i++)
               char     c = string.charAt(i);
               switch (c)
                    case '$':
                         if (i+1 < string.length() && string.charAt(i+1) == '{')
                              stack.push(sb);
                              sb = new StringBuffer();
                              i++;
                         break;
                    case '}':
                         if (stack.isEmpty())
                              throw new IllegalArgumentException("unexpected '}'");
                         String     name = sb.toString();
                         sb = stack.pop();
                         sb.append(super.getProperty(name, null));
                         break;
                    default:
                         sb.append(c);
                         break;
          if (!stack.isEmpty())
               throw new IllegalArgumentException("expected '}'");
          return sb.toString();
     public static void     main(String[] args)
          ResolvedProperties     pr = new ResolvedProperties();
          pr.setProperty("first.name", "Esmond");
          pr.setProperty("surname", "Pitt");
          pr.setProperty("degrees", "B.A.");
          pr.setProperty("memberships", "MIEEE FACS");
          pr.setProperty("FullName", "${first.name} ${surname} ${degrees} ${memberships}");
          String     s = pr.getProperty("FullName");
          System.out.println(s);
}

Similar Messages

  • Fuego.io.properties file

    I would like to know how to implement the properties file.I have the code for the properties file(key,value pairs defined) .In a process ,I have a global automatic activity where I am getting the values for the keys in properties file .My question is under what activity do I need to write the code for the properties file.How do I hook it up with the process that is using this properties file.Please help me as I am new to this tool.

    As per my understanding about your question let me reply for this.
    You can access the property file in any activity in the process. if the property values need to be accessed across the process then write the code once and assign the value to some instance variable where you dont need to write the code every where.
    Let me know if you have some specific scenario

  • How to read properties file(key-value) in OSB?

    Hi
    I have a scenario in which I have to read some properties(key-value) from a file. Earlier whole code was developed in java and its easy to read properties file in java.
    But now need to implement this in OSB and performance is very critical in this project.
    I followed DVM approached defined in
    http://blogs.oracle.com/christomkins/2010/02/domain_value_maps_in_oracle_se.html and http://blogs.oracle.com/christomkins/2010/02/domain_value_maps_in_oracle_se.html
    But it did not work. I have hundreds of properties(key-value pairs) to read and need pass them to the business service along with input of proxy service.
    What is the best approach for this (Can not go for db call as performance is very critical)?
    Thanks
    Vibhor

    $DVM= <dvm      name="InterfaceProperties" xmlns:ns1="http://xmlns.oracle.com/dvm" xmlns="http://xmlns.oracle.com/dvm">
         <columns>
         <column      name="PROPERTY_KEY" qualifier="false" order="1"/>
         <column      name="PROPERTY_VALUE" qualifier="false" order="1"/>
         </columns>
         <rows>
         <row>
         <cell>dealer.locate.default.buypower.link</cell>
         <cell>http://www.xyz.com</cell>
         </row>
         <row>
         <cell>dealer.locate.default.unitOfMeasure</cell>
         <cell>MILES</cell>
         </row>
         <row>
         <cell>dealer.locate.brand.identifier.nu</cell>
         <cell>Nurun</cell>
         </row>
         <row>
         <cell>dealer.locate.brand.identifier.bu</cell>
         <cell>Buick</cell>
         </row>
         <row>
         <cell>dealer.locate.brand.identifier.ca</cell>
         <cell>Cadillac</cell>
         </row>
    </rows>
    </dvm>
    XPATH is- ns1:dvm/ns1:rows[1]/ns1:row[1]/ns1:cell[1]/text()
    If I run this xpath in Jdeveloper,its giving me proper output.
    Please this as CQuery resource and try to run this xpath on OSB console.
    Thanks
    Vibhor
    Edited by: Vibhor Rastogi on Sep 21, 2010 4:59 AM

  • 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

  • Output of cmd in command prompt as key and vaule in properties file

    hi,
    i want to get the value of any command which i run using cmd in a properties file as a key and value rather then getting it in text file
    for example - hostname>output.txt   [not good], i want it to be like hostname>output.properties with a key and its value as output.
    command - `hostname`
    output - userpc
    but i want the same output in a properties file like
    xyzkey=userpc   in sample.properties file.
    it would be a great help.
    thanks
    sid

    I am sorry to say that it is not possible to understand what you are asking.
    Please post a copy of your script with any error messages.
    ¯\_(ツ)_/¯

  • Retreiving only particular keys from a properties file

    hello friends,
    can someone kindly tell me , is there any way to retreive only particular keys from a properties file .
    for e.g the file is as follows
    abc.properties
    ad_1 = "hello"
    ad_1_fg = "bye"
    ad_1_hj = "dfd"
    ad_1_jk = "sdfsdf"
    bk_2_jk = "sdfdsf"
    bk_2_lk = "klklk"
    so lets say at run time , i get the key ad_1 , and i am told to retreive all the keys from the properties file starting only with ad_1, then how do i do it.
    I tried using ResourceBundl,PropertyResourceBundle, but they all get all the keys, and tehre is no way to specify within them that get only keys with particular format.
    please do help me

    Retrieve all the properties, and then loop over them
    looking for those whose names match the pattern you
    need.hello jverd thanks for your quick response, i was thinking the same, but lets say i retreive all keys, then how do i match them to my pattern, i mean if some keys is like this jhk_ad_1 , so i dont want that , i only want keys starting from ad_1 , hope u got what i am trying to say.
    i mean i want all the keys that are starting from the runtime value i am getting

  • JRE7Update25 Deployment Properties File Not Working And Cant Disable Next Gen Plugin

    Good Day
    Our organisation needs to deploy JRE7U25 to over 4000 workstations. Our desktops are running the following Windows and IE combinations:
    WinXP 32 Bit/IE7
    WinXP 32 Bit/IE8
    Win7 32 Bit/IE8
    Win7 32 Bit/IE9
    Win7 64 Bit/IE8
    Win7 64 Bit/IE8
    We use the 32bit JRE installer across all environments and all IE browsers use 32Bit IE. On all of our environments the Deployment.properties and config files no longer work due to what appears to be a bug in the JRE7U25 installer. Our deployment files are as follows:
    Deployment.config
    deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
    deployment.system.config.mandatory=true
    Deployment.properties
    deployment.security.level=MEDIUM
    deployment.security.level.locked=
    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=
    deployment.security.mixcode=HIDE_RUN
    deployment.security.mixcode.locked=
    deployment.console.startup.mode=HIDE
    deployment.console.startup.mode.locked=
    Both files are being copied to the following location:
    C:\Windows\Sun\Java\Deployment
    After the installer runs and deployment files are copied to the workstation the deployment.properties and config files look like this:
    Deployment.config
    deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
    deployment.system.config.mandatory=true
    Deployment.properties
    #System Deployment Properties
    #Mon Jul 01 12:29:20 CAT 2013
    deployment.security.level=MEDIUM
    I have tried changing the deployment.config file as follows in an attempt to fix this to no avail:
    1. deployment.system.config=C:\\WINDOWS\\Sun\\Java\\Deployment\\deployment.properties
        deployment.system.config.mandatory=true
    2. deployment.system.config=C:\\WINDOWS\\Sun\\Java\\Deployment\\deployment.properties
        deployment.system.config.mandatory=false
    3. deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
        deployment.system.config.mandatory=true
    4. deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
        deployment.system.config.mandatory=false
    5. deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    None of the above mentioned works. So all our required settings in the deployment.properties file are being overwritten when opening the Java console? Our other major problem is that Changing the registry key to 0 in order to disable the next generation plugin does not disable the next generation plugin in Jre at the usual location as it worked for us machine wide (across multiple profiles for JRE6U29):
    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\10.25.2]
    "UseNewJavaPlugin"=dword:00000000
    ^^I have observed on a fresh install of JRE7U25 that the above mentioned registry key no longer exists in this version so a computer wide disablement of this option is no longer possible via the registry.
    On our 32Bit and 64bit machines running the 32 bit JRE 7U25 client when we disable the next generation plugin it keeps enabling itself again. Even when we run the javacpl.exe to run as administrator by changing the compatibility settings and disabling the next generation plugin it enables itself again. This is a huge problem for us because our company Oracle web based applications need this plugin to be disabled in order to run the apps properly.
    These are major obstacles for our deployment as we desperately require assistance or any advice in addressing these issues as there appear to be numerous bugs with the JRE7U25 release. Thank you in advance.
    Update 7 July 2013:
    I have observed that if you have the following options in your Deployment.config file it doesn't allow our java webstart apps which use jnlp extensions to run.
    1. deployment.system.config=C:\\WINDOWS\\Sun\\Java\\Deployment\\deployment.properties
        deployment.system.config.mandatory=true
    2. deployment.system.config=C:\\WINDOWS\\Sun\\Java\\Deployment\\deployment.properties
        deployment.system.config.mandatory=false
    3. deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
        deployment.system.config.mandatory=true
    4. deployment.system.config=C:\WINDOWS\Sun\Java\Deployment\deployment.properties
        deployment.system.config.mandatory=false
    The jnlp file association is also broken on Windows XP workstations with JRE7U25. We are having to manually associate the .jnlp file extension with javaws.exe on workstation for Web start apps or else users cannot lauch JRE whn clicking on .jnlp links.
    The only Deployment.config syntax which allows our Webstart applications to run is as follows:
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    What a mess!

    I don't have an answer to the problem, but I am having problems with the system level deployment.properties file and IE9 on Windows 7 32/64bit.
    Starting with version 13, the IE plugin seems to igonore the system level deployment.properties file in favor of the user level deployment.properties file. When I open the Java Control Panel, the settings are correct per the system deployment.properties file. Currently to get the Java Plugin to work reliably in IE9 I have to set the following:
    _JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true
    Disable caching
    Set the proxy to Direct Connection.
    If I set the _JAVA_OPTIONS as an environment variable and the other two in the system deployment.properties file, Firefox works fine, but IE wont load either of the Java tests. If I removed the system deployment.properties files and configure the user deployment.properties file, both IE and Firefox work fine.
    I find it interesting that if I set the configuration through the control panel, then apply the system deployment.propteries file, the user deployment.properties file reverts to defaults when the system file is removed.

  • How Can i specify multiple server names in rwservlet.properties  file?

    How Can i specify multiple server names in rwservlet.properties file without clustering?
    I am using oracle 10g Application server. we have 3 servers Repsvr1, RepSvr2 and RepSvr3. Now i need to configure rwservlet.properties file to point to these servers based on any running report. i got 3 keymap files with reports info.
    Sample entry in the key map file is:
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    rwservlet.properties file letting me to enter only one servername. Even though i merged all 3 keymap files into 1, still i have the server name issue. If i leave the server to the default name still i am getting the below error.
    REP-51002: Bind to Reports Server Repsvr1 failed. However, i know the default rep_<servername> would be used incase we dont have SERVER=<value> parameter in the rwservlet.properties file.
    If i specify the servername in the rwservlet.properties file then only Repsvr1 reports are working fine and other 2 server reports are giving the same error like
    REP-51002: Bind to Reports Server <<Server Name>> failed.
    how can i configure the info which will work all 3 reports. 2 Port servers are invoking using oracle forms and report server is invoking using ASP pages.
    If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error, whenever i am trying to integrate all 3 to workable i am getting binding error. if i exclude the server from rwservlet.properties still i am getting the same error.

    My RELOAD_KEYMAP setting is YES only.As i said If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error.
    keymap file entries
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    If i use http://server.domain:port/reports/rwservlet? cmdkey = key1 should bring the report from Repsvr1 and http://server.domain:port/reports/rwservlet? cmdkey = key2 should bring the report from Repsvr2, but i am getting an error from Repsvr2 saying that REP-51002: Bind to Reports Server repsvr2 failed.
    Only Servername Repsvr1 is in rwservlet.properties file. Now what is the best option to by pass the server from rwservlet.properties file and should be from keymap file. if i comment server name in rwservlet.properties file still i am getting REP-51002: Bind to Reports Server <<Server Name>> failed error for both keys.

  • Using Multiple Properties Files in Struts Framework

    Hi Everybody!
    I just to know how to use a multiple message-resources files in a Struts Framework.
    I've 2 properties file :
    1. ApplicationResources_A.properties
    2. ApplicationResources_B.propertiesI put the files under WEB-INF/classes dir.
    My configuration in struts-config file something like below:
    <!--  Begin Testing -->
         <message-resources key="A" parameter="ApplicationResources_A" />
         <message-resources key="B" parameter="ApplicationResources_B" />
    <!--  End Testing -->
    </struts-config>
    if my JSP code is like below , this error is thrown:
    org.apache.jasper.JasperException: Cannot find message resources under key A
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message bundle="A" key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message bundle="B"  key="user.lang.desc"/></td>
      </tr>
    but  if I change the  JSP code like below it  work fine:
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message  key="user.lang.desc"/></td>
      </tr>
    In this code , I dont know  which resources file is used.
    So how do I solve this problem. Thanks you.

    I have defined the following:
    struts-config.xml
    <message-resources key="ldap" parameter="com/project/struts/ldap"/>
    Action.java
    In execute method:
    MessageResources messageResources= MessageResources.getMessageResources("com/project/struts/ldap");
    System.out.println("INITIAL_CONTEXT_FACTORY"+messageResources.getMessage("INITIAL_CONTEXT_FACTORY"));
    and it is working, however I have to change "com/project/struts/ldap" value in Action.java file whenever there is any change in name or location of ldap.properties.
    Can I access this properties in such way that I don't have to change parameter path manually in Action.java (modifying in struts-config.xml is okay)? like access through key="ldap" or something.
    Thanks and regards,

  • Doubts in reading a '.properties' file

    Hi All,
    I have a doubt regarding properties file from which I am reading some key-values. Now I have few different keys (4-5) having same value .e.g.
    key1=value1
    key2=value1
    key3=value1
    key4=value1
    key5=value1
    Now I need to read these keys from different places and I also need to update the value to say 'value2' for all the keys e.g.
    key1=value2
    key2=value2
    key3=value2
    key4=value2
    key5=value2
    Now, since i need to update the values of all the keys, I am thinking of having another key-value pair (e.g. key=value1) in the same property file, and using the value of this key as value for all the keys displayed above. So that when I update the value of this key ( key=value2), I dont need to update the values of all the keys, since those keys will be reading the values from this key's value.
    I hope i am clear with this explanation.... ;-)
    My first question is, 'IS IT POSSIBLE' ???
    If yes, then how????
    Thanks in advance
    Inder Jeet Singh

    The following little class is from my old bag of tricks:import java.util.Properties;
    public class XProperties extends Properties {
         public static final String BEG= "${";
         public static final String END= "}";
         public XProperties() { super(); }
         public XProperties(Properties def) { super(def); }
         public String getRawProperty(String key) { return getRawProperty(key, null); }
         public String getRawProperty(String key, String def) {
              return super.getProperty(key, def);
         public String process(String val) {
              for (int i, j, n= val.length(); n >= 0 && (i= val.lastIndexOf(BEG, n)) >= 0 &&
                (j= val.indexOf(END, i)) >= 0; ) {
                   String pat= val.substring(i+BEG.length(), j);
                   String sub= super.getProperty(pat);
                   if (sub != null) {
                        val= val.replaceAll("\\Q"+BEG+pat+END+"\\E", sub);
                        n= val.length();
                   else
                        n= i-1;
              return val;
         public String getProperty(String key) { return getProperty(key, null); }
         public String getProperty(String key, String def) {
              String val= super.getProperty(key);
              return val == null?def:process(val);
    }If you use an XProperties object instead of a Properties object
    you can do the following in your .properties file:key= value1
    key1= ${key}
    key2= ${key}
    key3= ${key}
    key4= ${key}
    key5= ${key}... if you want to change the value, all you have to do is change the
    value of the 'key=value1' line.
    kind regards,
    Jos

  • In a new Application, the ApplicationResources_en.properties file is not having the constraint messages created

    Hi Everyone:
              We are using JDev 11.1.2 and JHeadstart 11.1.2.  We have been having a multitude of problems when running applications through the migrator (and we have now been told by an Oracle consultant that the migrator is problematic), so we are trying to re-write things from scratch to bring them over from 11.1.1.4 to 11.1.2.
              I have been working on a simple application from scratch and discovered that the messages for constraints on the entities that I am using are not showing up in the ApplicationResources_en.properties.file.  We noticed a similar thing with converting an application using the migrator and that post is found here - java.lang.NullPointerException ADF_FACES-60097 message ***WITH SOLUTION*** -. 
              However, I didn't get a single reply to that thread. 
              I initially thought it was a migration issue, but this application is from scratch.  Whenever I tried to input an invalid value into a page column, the following exception would be received.
    "java.lang.NullPointerException  ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #"
               This Null Pointer turned out to be the missing message from the ApplicationResources_en.properties file.  In the new application I just wrote, I had to manually edit to add the following lines to the ApplicationResources_en.properties file and the application no longer gives me the error if I input an invalid value.
    VALIDATE_FEE_CATEGORY_3=Feecategory with this FeeCategory does not exist
    VALIDATE_ACADEMIC_TERM36=Academicterm with this EffectiveTermStart does not exist
    VALIDATE_ACADEMIC_TERM36_CASDEL=Cannot delete Academicterm while dependent Specialexchange exists
    VALIDATE_ACADEMIC_TERM37=Academicterm with this EffectiveTermEnd does not exist
    VALIDATE_ACADEMIC_TERM37_CASDEL=Cannot delete Academicterm while dependent Specialexchange exists
    VALIDATE_CURRENCY23=Currency with this Currency does not exist
    VALIDATE_CURRENCY23_CASDEL=Cannot delete Currency while dependent Specialexchange exists
    VALIDATE_FEE_CATEGORY_3=Feecategory with this FeeCategory does not exist
    VALIDATE_FEE_CATEGORY_3_CASDEL=Cannot delete Feecategory while dependent Specialexchange exists
    These constraints are found in the Entities .xml files  as shown below.  We are using a re-usable business components .jar file to import them in.
      <Key
        Name="UniqueFeeCategory"
        PrimaryKey="true">
        <DesignTime>
          <Attr Name="_DBObjectName" Value="UNIQUE_FEE_CATEGORY"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item
            Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.FeeCategory"/>
          <Item Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.Currency"/>
          <Item
            Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.EffectiveTermEnd"/>
        </AttrArray>
      </Key>
      <Key
        Name="ValidateAcademicTerm36">
        <DesignTime>
          <Attr Name="_referencedKey" Value="UNIQUE_ACADTERM_CODE"/>
          <Attr Name="_isForeign" Value="true"/>
          <Attr Name="_DBObjectName" Value="VALIDATE_ACADEMIC_TERM36"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item
            Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.EffectiveTermStart"/>
        </AttrArray>
      </Key>
      <Key
        Name="ValidateAcademicTerm37">
        <DesignTime>
          <Attr Name="_referencedKey" Value="UNIQUE_ACADTERM_CODE"/>
          <Attr Name="_isForeign" Value="true"/>
          <Attr Name="_DBObjectName" Value="VALIDATE_ACADEMIC_TERM37"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item
            Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.EffectiveTermEnd"/>
        </AttrArray>
      </Key>
      <Key
        Name="ValidateCurrency23">
        <DesignTime>
          <Attr Name="_referencedKey" Value="UNIQUE_CURRENCY_CODE"/>
          <Attr Name="_isForeign" Value="true"/>
          <Attr Name="_DBObjectName" Value="VALIDATE_CURRENCY23"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.Currency"/>
        </AttrArray>
      </Key>
      <Key
        Name="ValidateFeeCategory3">
        <DesignTime>
          <Attr Name="_referencedKey" Value="UNIQUE_FEECAT_CODE"/>
          <Attr Name="_isForeign" Value="true"/>
          <Attr Name="_DBObjectName" Value="VALIDATE_FEE_CATEGORY_3"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item
            Value="its.sis.uwbm.AREdit.entityobjects.Specialexchange.FeeCategory"/>
        </AttrArray>
        Is this a known bug (I have searched and havent found it) and is there anything that I can do about it without having to manually add the messages?
    Mary
    UofW

    Hi Everyone:
               I have done some further testing.  We are using a re-usable Business Components .jar file to access our entities.  We import the .jar file into the project and create the ViewObjects and ViewLinks from that .jar file.
                It APPEARS that a test case using the HRSchema and using the Entities & Associates generates the constraint error messages, but when I use the .jar file of re-usable business components imported into the project, those constraint error messages are not created in the ApplicationResources_en.properties file.  I have created two testcases as well as the re-usable .jar file that I can send to you to show what I mean. 
                This behaviour seems to have shown up in 11.1.2 as there was no problem before this.
                 Please let me know where you'd like me to upload the testcases.
                 Thank you.
    Mary
    UofW

  • SecStore.properties file - need to regenerate-Sys Copy of SAP NetW BI 7.0

    Hello Experts,
    I'm having an issue with a follow up activity of a recent System Copy-> SAP NW 2004s ABAP & JAVA Stack ->System copy of our Production BI system to a Sandbox system. (HP-UX servers 11.23 / Oracle 10g) Our SecStore.properties file contains the Production Source system's credentials and I am unable to update the properties using the configtool.sh or offlinecfgeditor.sh scripts. I am receiving the following error:
    system.log from offlinecfgeditor.sh
    ... #2#com.sap.sql.log.OpenSQLException#Error while accessing secure store: The encryption key (usually in the key file) is not the key that is required to decrypt the data in the secure store file or the system name (SID) is wrong..#
    The SID in the below file contains our production sid (BWP) and needs to be (BWX-our target system)
    /usr/sap/BWX/SYS/global/security/data/SecStore.properties
    Is there anyway to reconfigure this property file other than the 2 scipts listed above?
    I have tried to set the file and directory permissions to 777; I'm still getting the same error message. Our properties file still has the source SID within the file (BWP). We want to use the offlinecfgeditor.sh script to change this but we get the error.
    Thanks,
    Laurie

    Hello Manoj,
    Thanks for your reply.  I have tried running the ./configtool.sh.  I am receiving the same error:
    Error occurred while loading the secure store.  Msg: The encryption key (usually in the key file) is not the key that is required to decrypt the data in the secure store file or the system name (SID) is wrong.
    I was told that a system copy (following SAP's recommendation for a system copy) was followed for this target system I'm having an issue with.  A system copy of our production BW system was performed.  The secure store files still contain the Source (production BWP sid within the file).
    Other suggestions?
    Thanks again!
    Laurie
    Full System Log from configtool.sh:
    bwxadm> cat system.log
    <!LOGHEADER[START]/>
    <!HELP[Manual modification of the header may cause parsing problem!]/>
    <!LOGGINGVERSION[1.5.3.7185 - 630]/>
    <!NAME[./system.log]/>
    <!PATTERN[system.log]/>
    <!FORMATTER[com.sap.tc.logging.ListFormatter]/>
    <!ENCODING[UTF8]/>
    <!LOGHEADER[END]/>
    #1.# #1247145554041#/System/Configuration/Logging##com.sap.tc.logging.APILogger.LogController[addLog()]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_NEW_ITEMS[C0000A305666000000000002018FB1F70003D67C779ECE88]##The () has been added to the !#3#Log#./system.log#/System#
    #1.# #1247145554114#/System/Server##com.sap.engine.core.configuration#######Thread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store /sapmnt/BWX/global/security/lib/tools/iaik_smime.jar#
    #1.# #1247145554115#/System/Server##com.sap.engine.core.configuration#######Thread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store /sapmnt/BWX/global/security/lib/tools/iaik_ssl.jar#
    #1.# #1247145554115#/System/Server##com.sap.engine.core.configuration#######Thread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store /sapmnt/BWX/global/security/lib/tools/w3c_http.jar#
    #1.# #1247145554115#/System/Server##com.sap.engine.core.configuration#######Thread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store /sapmnt/BWX/global/security/lib/tools/iaik_jce.jar#
    #1.# #1247145554116#/System/Server##com.sap.engine.core.configuration#######Thread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store /sapmnt/BWX/global/security/lib/tools/iaik_jsse.jar#
    #1.# #1247145554546#/System/Configuration/Logging##com.sap.tc.logging.APILogger.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the has been changed from to )!#5#resource bundle name#LogController#com.sap.security.core.server.secstorefs.SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStoreFSResources#
    #1.# #1247145554546#/System/Configuration/Logging##com.sap.tc.logging.APILogger.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the has been changed from to )!#5#resource bundle name#LogController#/System/Security/SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStoreFSResources#
    #1.# #1247145559803#/System/Configuration/Logging##com.sap.tc.logging.APILogger.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the has been changed from to )!#5#resource bundle name#LogController#/System/Database/sql/connect#<null>#com.sap.sql.log.OpenSQLResourceBundle#
    #1.# #1247145559803#/System/Database/sql/connect##com.sap.sql.connect.OpenSQLDataSourceImpl#######Thread[main,5,main]##0#0#Error#1#com.sap.sql.connect.OpenSQLDataSourceImpl#Java#com.sap.sql_0019#com.sap.sql.log.OpenSQLResourceBundle#Exception of type caught: .#2#com.sap.sql.log.OpenSQLException#Error while accessing secure store: The encryption key (usually in the key file) is not the key that is required to decrypt the data in the secure store file or the system name (SID) is wrong..#

  • Issue in reading multiple time properties file

    Use Case:
    I have a page in which i have to show some Outage Messages on page. So I have configured outage message in properties files. This message should me rendered each time when it finds that properties file in class path or it finds the values w.r.t their keys.
    So what I decide that I shall write java method and call this method on Loading the page but here what happen is that whenever that page is load each time that reader file will call , that will create memory leak .
    So, anyone help me on this. What will be the best approach for that reading multiple times properties file?
    I will be grateful for any help you can provide
    Thanks

    Hi,
    have a bean at applicationScope, somewhat like this
    import java.util.HashMap;
    public class ApplnProperties {
        private HashMap _propMap;
        public HashMap getPropMap() {
            if(_propMap == null){
                //read the properties file and populate _propMap
            return _propMap;
    }here we put condition _propMap == null so it would be called only once during application lifecycle.
    and on page you can refer the prop map like following
    #{beanName.propMap['KEY1']}Regards,

  • File I/O problems using a Properties file

    Hi,
    I am having troubles reading in a properties file. The file looks like this:
    aname=apassword:word2
    bname=bpassword:word
    ...etc
    The code I have this far is:
    import java.util.*;
    import java.io.*;
    public class LoginH
    public static void main(String[] args)
    String logon, pswd;
    //String login = null;
    //String password = null;
    //String nick = null;
    int msg = 0;
    System.out.print ("Login: ");
    logon = MyInput.readString();
    System.out.print ("Password: ");
    pswd = MyInput.readString();
    Properties settings = new Properties();
    try
    FileInputStream sf
    = new FileInputStream("LogonH.ini");
    settings.load(sf);
    catch (FileNotFoundException e) {}
    catch (IOException e) {}
    // public void whitespaceChars(58,58)
    StringTokenizer st = new StringTokenizer(settings.getProperty(logon));
    String password = st.nextToken();
    String nick = st.nextToken();
    System.out.print (password + nick);
    ** It works fine if i replace the colon in my properties file with a blank space, However i need to use a colon. I tried to set whitespaceChar to allow this but I can not seem to get it to work. Let me know if you have any ideas. Thanks in advanced.

    Thanks. I just got done doing something to that nature however now my problem is if the key field is not in my properties file my program crashes. I need to print out to the console "sorry" if my user name which is my key is not in the properties file. Here is my code if anyone can help me out:
    import java.util.*;
    import java.io.*;
    public class LoginH
    public static void main(String[] args)
    //******** Declare Variables *********************
    String userlogin;
    String userpaswd;
    String login = null;
    String paswd = null;
    String nicknm = null;
    int match=0;
    String delim = ":";
    //******** Get username and password **************
    System.out.print ("Login: ");
    userlogin = MyInput.readString();
    System.out.print ("Password: ");
    userpaswd = MyInput.readString();
    Properties settings = new Properties();
    try
    FileInputStream sf = new FileInputStream("LogonH.ini");
    settings.load(sf);
    catch (FileNotFoundException e) {}
    catch (IOException e) {}
    StringTokenizer st = new
    StringTokenizer(settings.getProperty(userlogin),delim);
    paswd = st.nextToken();
    nicknm = st.nextToken();
    if(userpaswd.equals(paswd))
    System.out.println("Ok " + nicknm);
    match = 2;
    else
    System.out.println("Sorry " + nicknm);
    match = 1;
    if (match == 0) System.out.println("Sorry");
    }

  • How to include the characters " " and " " in a XML properties file.

    hi
    including the following prop entry gives me the error "Element is not closed" error message.
    <entry key="test">can't include chars < and ></entry>
    But i need to include the chars "<" and ">" in my xml properties file.
    please help.
    thanks

    Try &lt; and &gt;
    Dave Patterson

Maybe you are looking for