Placing of properties.ini file

Hi
where should i place my properties.ini file inside an EAR, so a simple class can read it ?
I tried put it in the package of the class who read it but I get an FileNotFoundException.
thanks

Hi
where should i place my properties.ini file inside an
EAR, so a simple class can read it ?"properties.ini"? Why not "xyz.properties" like everyone else uses?
Anyway, store it in any of your application JARs.
I tried put it in the package of the class who read
it but I get an FileNotFoundException.You're not supposed to use direct File IO in J2EE. Use Class.getResourceAsStream(), together with Properties.load().

Similar Messages

  • Where Can the Preference Settings to place in the .INI File Found

    I can not find a lot of the settings that are found on the drop down list under the Menu item Edit - Preferences. Specifically I am looking for the setting to stop Acrobat asking clients to update. I know it can be done manually. I deliver Acrobat over the company network to thousands of clients of which my helpdesk cannot go to everyone of them. Where is the setting found. In the .ini file or in the registry and what is the actual code to be placed in the .ini file or the HKey in the registry?

    Here's how to find various registry keys:
    1. Open RegEdit. Navigate to HKCU and Export The Adobe Acrobat hive under the Software/Adobe key. Close regedit
    2. Launch Acrobat and make your preference change.
    3. Open Regedit again and export the Adobe Acrobat hive again. Us a program that can compare text and find the change thats was made.

  • Problem with placing of properties file

    Hi all,
    Iam using a properties file.
    From a jsp, Iam reading the property file.....
    Its giving FileNotFoundException....
    I hope its problem with placing of my properties file...
    I placed the properties file in WEB-INF/classes..folder.....
    But still iam getting the FileNotFoundException...
    PLz tell me where exactly should I place my properties file...
    Thanks ....

    first rule of using a forum: read recent topics !
    http://forum.java.sun.com/thread.jspa?threadID=668488&tstart=0

  • Placing ini file in specific location when building the application

    Hello,
       I have a small problem.  I have an ini file that I use to store certain parameters.  Lets call this file app.ini.  When I build the Application.exe, it puts that file into the data directory.  I was hoping that it would be one level higher and be located in the same directory as Application.exe is (otherwise it won't read the file correctly.)  I looked at the Source File Settings in the Category list in the properties window for the build and set the Destination to be "Same as caller", but that didn't put it where I wanted it.  I'd really like this file to be one directory higher when I make my build in order for my app to read it correctly.  Any suggestions?
    I use this executable later on when I make my installer and the problem simply propagates there too, not good.
    Solved!
    Go to Solution.

    One way to solve the problem:
    1) In build properties window select Destinations and create a new destination. Select as "Destination Path" the same dir where the exe will be stored
    2) Assign this destination to the .ini file.
    Let me know if it works
    Marco

  • Propblem with Properties class and .ini file !

    Hello I have to read and write in a .ini file. I've got no problem, using a bit of code like this
    Properties iniFile = new Properties();
    String result="exception";
    try{     
    iniFile.load(new FileInputStream(path));
    result = iniFile.getProperty("SrcPath","not found");     
    catch(IOException e){}
    finally{return result;}
    it works correctly, but my problem is that my .ini file contain path like "SrcPath = e:\directory1\directory2"
    And then in my result variable I get : "e:directory1directory2" all the slash are cutted by iniFile.load !!
    And the problem is that I can not put "\\" in my ini file because it is used by other programs that need just one slash !!!!
    Is anybody got an idea to get the right path "e:\directory1\directory2"
    Thanks by advance Eric

    1st question.
    Properties props = new Properties();
         try{
              String uploadprop = "c:/yourinifile.ini";
              File file = new File(uploadprop);
         FileInputStream fis = new FileInputStream(file);
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              int character;
              while((character=fis.read()) != -1){
              baos.write(character);
              if((char)character == '\\')
                   //write one more '\'
                   baos.write(character);
              ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
              baos.close();
              //load bais
              props.load(bais);
              bais.close();
              fis.close();
              System.out.println(props.getProperty("dirname"));
         }catch(Exception e){
    hope this helps
    rishi

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • Need help on resolving the issue with adobe output server - error MSG256 & MSG 210 not in .ini file

    Hi,
    I am using adobe output designer 5.5 for designing the label template and using the Adobe output server for printing process.
    In the Jfmerge.ini we given the condition "DiscardUnknownFields=Yes" for ignoring the unwanted fields in the .dat file.
    During the process, I faced some issue with the output server in printing the labels.
    When the .dat file is placed in the Data folder of adobe, the label is not getting printed in the printer.
    The file is move to the error folder and an error file is getting generated which contains the error message as given below:
    090826 02:59:02 D:\Program Files\Adobe\Central\Bin\jfmerge: [256]** Message Msg256 not in .ini file **
    090826 02:59:02 D:\Program Files\Adobe\Central\Bin\jfmerge: [210]** Message Msg210 not in .ini file **
    2009/08/26 02:59:02 D:\Program Files\Adobe\Central\Bin\jfserver.exe: [314]Agent exit message: [210]** Message Msg210 not in .ini file **
    The output server is a new installtion and I verified the Jfmerge.ini file. It contains the message details of Msg256 and Msg210.
    I also verified the license and it is a valid licence.
    Kindly help me out in solving this issue.
    Thanks
    Senthil

    I assume this is too late to help you, but other might need a hint.  I had the same problem, and found some possible causes that I posted on http://codeznips.blogspot.com/2010/02/adobe-output-server-message-msg210-not.html.
    It is quite likely that you are missing some double quotes around the path specifying the ini file (-aii), if its installed under "Program Files".
    Hope this helps anyone....
    Vegard

  • How to create the ini file for java programms

    hi all,
    I have one problem that is ...
    In my project I am using the JDBC connection ...
    in this I am connecting different connections (means differenet usernames and passwords)...
    for this evrey time I have to change the username and password in the
    hardcode ...
    I think that some ini file are there in java ...
    So if anyone knows about use of ini files in java please
    send me..
    thanks........

    In java they are called properties files.
    Look at java.util.Properties which provides methods for reading, writing, etc.

  • Modification to SAP Logon Cannot be written to INI file

    Hi,
    When i am trying to create a New Item in SAP logon it is giving an error "Modification to SAP logon could not be Written to INI file
    Check permission for file 'C:\Windows'.
    The problem is that, this is showing even when i m logged in as "XXXADM".
    I have Reinstalled the SAP GUI, but the problem is as it is.
    OS: WINDOWS 2003 server
    Database: Oracle.
    Please help me.
    Thanks in advance,
    Sharib

    I had this same problem under a VISTA Enterprise client setup.  I tried all the various recommendations, including setting the SAPLOGON_INI_FILE environment variable to point to c:\windows\saplogon.ini.  None of these changes worked, I even modified the file ownership to match up with my logged on user without success.
    I then looked at the shortcut for launching SAPLOGON, and tried to set the shortcut to run as an Administrator.  That option was greyed out.  I deleted the shortcut, and re-created it.  Still unable to save changes.  I then set the new SAPLOGON shortcut to execute as the administrator, and once I confirmed that I trusted the program, everything is now working as it should.
    Not content to leave it this way, I moved my saplogon.ini file OUT of the c:\windows directory and instead placed it in the directory pointed to by %USERPROFILE%\saplogon.ini .  I updated the environment variable setting and also removed the falg to execute the shortcut as the system administrator.
    Now everything is working as it should without any special hoops -- seems that even with full access, VISTA security would not let a domain user that was part of the PC's Administrators account to edit the file w/o running as the system administrator.
    Edited by: David L. Flad on Oct 30, 2009 4:02 AM

  • Using CookieName in the iisproxy.ini file

    Hello All,
              According to the Weblogic 451 docs, In the IISProxy.ini file, you should
              set the "CookieName= "
              property to whatever value you have specified for the
              "weblogic.httpd.session.cookie.name="
              property in your weblogic.properties file. (If it is anything other than the
              default name which is "WeblogicSession").
              We have an IIS proxy fronting 2 Weblogic App Servers which run in a
              clustered mode. Also the
              cookie name is specified in the properties file to something different than
              the default WeblogicSession
              (lets say it is "mySession").
              When we do this we see the strange behavior of the application routing us
              back to our Login page in the middle
              of a session. We assume this is happening because when our request is
              switched to a different App Server it
              cannot be associated with any session. And so we are asked to login and
              create a new session.
              This started happening only when we switched to using IIS Proxy and have the
              CookieName
              set to "mySession". This problem goes away if we change the cookieName to be
              the default and remove
              the entry from the IISProxy.ini file.
              Our App Servers are running Weblogic 4.5.1 with sp8.
              Any ideas ??
              Thanks
              Ketan.
              

    The cookie name in your ISAPI plugin and weblogic.properties should be the
              same in all your plugins and weblogic servers. This is required. Plugin and
              WLAS share the same cookie. However, plugin and WLAS are in different
              processes. In order for plugin and WLAS to locate the same cookie, same
              cookie name in the configuration is required.
              Cheers - Wei
              Ketan Bhukhanwala <[email protected]> wrote in message
              news:[email protected]...
              > Hello All,
              >
              > According to the Weblogic 451 docs, In the IISProxy.ini file, you should
              > set the "CookieName= "
              > property to whatever value you have specified for the
              > "weblogic.httpd.session.cookie.name="
              > property in your weblogic.properties file. (If it is anything other than
              the
              > default name which is "WeblogicSession").
              >
              > We have an IIS proxy fronting 2 Weblogic App Servers which run in a
              > clustered mode. Also the
              > cookie name is specified in the properties file to something different
              than
              > the default WeblogicSession
              > (lets say it is "mySession").
              >
              > When we do this we see the strange behavior of the application routing us
              > back to our Login page in the middle
              > of a session. We assume this is happening because when our request is
              > switched to a different App Server it
              > cannot be associated with any session. And so we are asked to login and
              > create a new session.
              >
              > This started happening only when we switched to using IIS Proxy and have
              the
              > CookieName
              > set to "mySession". This problem goes away if we change the cookieName to
              be
              > the default and remove
              > the entry from the IISProxy.ini file.
              >
              > Our App Servers are running Weblogic 4.5.1 with sp8.
              >
              > Any ideas ??
              >
              > Thanks
              > Ketan.
              >
              >
              

  • .bat file and .ini file

    I have a batch file with the following contents, I need to substitute the paths \\folder\projectname\formatter\saxon8\ with a variable using .ini file. Could anyone please tell me how do I do this
    @echo off
    cls
    echo.
    set CP=\\folder\projectname\formatter\saxon8\saxon8-jdom.jar;\\folder\projectname\formatter\saxon8\saxon8-sql.jar;\\folder\projectname\formatter\saxon8\saxon8sa.jar;\\folder\projectname\formatter\saxon8\saxon-license.lic
    ...If the path of the needed files gets changed in future, the user need to change the path only in the .ini file and that should reflect in the .bat file.
    Message was edited by:
    Simmy
    Message was edited by:
    Simmy

    I am reading the INI file in my code whose value C:\\temp\\ is getting displayed in my Batch file, but I need to display only the keyword Path in my Batch file. Can you please tell me what modifications I need to do in my code.
    This is the contents of my INI file
    [INI file : user.ini]
    Path="C:\\temp\\"
    The following is my code
        public void createFile()
            try
                p = new Properties();
                p.load(new FileInputStream("D:/user.ini"));
                JarPath=p.getProperty("Path");
                p.list(System.out);
            catch(Exception e)
                System.out.println(e);
            File file1=new File("D:/temp/ps1.bat");
            BufferedWriter bw1;
            try
                bw1=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file1)));
                bw1.write("@echo off\n");
                bw1.write("cls\n");
                bw1.write("echo.\n");
                bw1.write("set CP="+JarPath+"saxon8-jdom.jar;"+JarPath+"saxon8-sql.jar;"+JarPath+"saxon8sa.jar;"+JarPath+"saxon-license.lic\n");
                bw1.flush();
            catch(IOException ioe)
                System.out.println("Error creating \"ps1.bat\". Process terminated.");
    Currently, the following is my Batch file contents
    @echo off
    cls
    echo.
    set CP=C:\temp\saxon8-jdom.jar;C:\temp\saxon8-sql.jar;C:\temp\saxon8sa.jar;C:\temp\saxon-license.lic
    But I need my Batch file to display
    @echo off
    cls
    echo.
    set CP=Path\saxon8-jdom.jar;Path\saxon8-sql.jar;Path\saxon8sa.jar;Path\saxon-license.lic

  • Is there an editor for the StationGlobals.ini file?

    I have TestStand 3.0 and I am trying to edit the StationGlobals.ini file. It seems that I am unable to delete/add properties from within TestStand. Is there an editor or a correct way of editing this file?
    Thanks in advance.
    Martin Blandon
    (561)629-3614
    [email protected]

    To linux_dude -
    The StationGlobals.ini file is generated by the TestStand engine and its format is an object oriented format that represents the structure of the property objects in the globals. Hand editing the file will be problematic. The only way to edit the station global strucutre is to do it in the sequence editor.
    Scott Richardson
    National Instruments

  • Gifs placed in a jar file. need help getting them.

    I have placed all the gif files in a jar file.
    added the gif.jar to the project in the required libraries of project properties.
    In the toolbar class I gave this.
    JButton btnNew = new JButton(new ImageIcon("new.gif"));
    and was expecting it to show the icon but I didn't get it?
    Can I place the gifs in a jar file.
    What else can I change/check to see the icons?
    Thanks.

    They are in the same path in the jar file that they were when they were on your disk in the file system. Lets say you have a dir structure
    C:\dir1\dir2\dir3\dir4\file.txt
    and you cd to dir2:
    cd \dir1\dir2
    then you jar dir3:
    jar cvf jar.jar dir3/*.*
    the path to file.txt would still be /dir3/dir4/file.txt inside the jar file.
    do a jar tvf jarfile.jar and take a look.

  • Gif files placed in a jar file. Help to get these files.

    I have placed all the gif files in a jar file.
    added the gif.jar to the project in the required libraries of project properties.
    In the toolbar class I gave this.
    JButton btnNew = new JButton(new ImageIcon("new.gif"));
    and was expecting it to shpw the icon but I didn't get it?
    Can I place the gifs in a jar file.
    What else can I change/check to see the icons?
    Thanks.

    Ok, lets try it this way:
    I have small samples on my server, which solve your
    problem. If you look at them, you can see
    how it works from a working example as starting point.
    CAUTION: This one ONLY works, if you have
    selected a JVM 1.3x.
    [ It doesnt work for jvm 1.4, because it references
    the main class in unnamed space. Thanks SUN ! -
    why was this needed ??? (security I guess) ]
    Steps:
    1) goto http://www.snowraver.org/java/index.htm
    2) download the "jarcreator.jar" example
    [ There is a small link "Download JarCreator.jar -
    although you also can start it as WebStart application
    if you click on the big button on that homepage ]
    3)
    The jar file contains the classes as well as the
    java source files and 2 gif pictures, which are
    loaded using the above explained method
    "LoadImageIcon"
    You can see how it works from that example.
    For extracting the source files, you can rename it
    and give it the ending .zip on windows, then
    you can extract all files using WinZip )
    The main class (called Idefix above) must be outside
    any package, that is, there must not be
    a package statement at the beginning.
    Some notes:
    If you are working without jar file, the method
    can return an ImageIcon object, although it
    couldnt find it. In this case, the width and length
    of that ImageIcon are zero.
    Usually no problem. But imagine you use the
    image icon for a tiled background. You loop
    would be endless then.
    It's a good idea to inspect the width of an imageicon
    for checking its greater zero.

  • Translat.ini File

    We are upgrading RP11.3 to RP11.5. We have a number of custom rules that have been merged into 11.5 batch system. The issue we are having is that after we merged our custom error messages for our custom rules into the translate.ini file, the system is not recognizing our entries. It seems that the 11.5 system is pulling these error messages from another file.
    How can we get the system to recognize our custom errors messages in translate.ini that we have created and used in past version of Documaker.

    Under 11.5, Documaker uses Oracle's globalization standards for messaging. The translat.ini file isn't strictly used at runtime, rather, a compiled binary version that is language-specific is used instead. To generate the compiled binary version, there are some steps to be followed.
    The first thing you will need is the LMSGEN utility from Oracle's NLSRTL package. Currently this is distributed with Oracle database SDKs. I don't have any more specific information than that right now. Here is a bit more info on this utility http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch10oci.htm#i1007610
    Once you have LMSGEN installed and ready, you need to convert your translat.ini into an intermediary MSG and MMP files. You can create a script that will translate your translat.ini file and create these files for you. It's a relatively simple process:
    Translat.ini lines:
    1000 = &E&: Error: Requested library <&LIB&> not available or cannot be loaded.
    1001 = &E&: Error: Use of rule or function <&NAME&> requires a printer classification of <&CLASS&>.
    Translat.msg:
    #CHARACTER_SET_NAME=AMERICAN_AMERICA.US7ASCII
    1000, 42, "%1: Error: Requested library <%2> not available or cannot be loaded."
    1001, 42, "%1: Error: Use of rule or function <%2> requires a printer classification of <%3>."
    Translat.mmp:
    1000:E,LIB,
    1001:E,NAME,CLASS,
    The MMP file is a token/parameter mapping file, since the old translat.ini uses tokens, and Oracle's globalization framework uses parameters. Note the top line in the translat.msg file -- this is required!
    The format of the INI file:
    msgNumber = &TOKEN&: Message with &TOKEN&
    The format of the MSG file:
    msgNumber, msgType [42=Error,0=Info], "Message with %1 parms"
    Format of the MMP file:
    msgNumber:TOKEN1,TOKENn,...,
    Once you have the MSG file, then use the LMSGEN utility from Oracle's NLSRTL package to converts that into an MSB file. The MSB file is a compiled binary version of the message file, and this is what is used to generate the actual messages. There will be a different MSG file for each language your system should support. In addition, the MSB files are platform dependent and must be compiled on the platform where they are intended to be used.
    One thing to keep in mind when running it is that Oracle's messaging libraries are built around the notion of each product having its own separate directory under the Oracle home directory (identified by the ORACLE_HOME environment variable). Each product may in turn have its own separate component or "facility" with its own set of message files. Oracle manages this by having a separate directory under ORACLE_HOME for each product, and then a "mesg" directory under that where the message files for every component are placed. When you run the lmsgen utility, it already expects there to be an Oracle base directory and an ORACLE_HOME environment variable that points to it. In addition it expects there to be a sub-directory for the product under the Oracle directory, and a "mesg" subdirectory under the product directory. When you run the lmsgen routine, it expects you to give it the name of the msg file, the name of the product, and the name of the facility. It uses the product name to locate the "mesg" subdirectory, and it uses the "facility" name as the base name of the msb file that it generates (the filename is suffixed by the language). So, to run lmsgen you will need to have a directory which has some directory underneath with a "mesg" directory under it. So for example (assuming you don't have Oracle code already installed somewhere) you could do the following:
    mkdir C:\Documaker\mesg
    set ORACLE_HOME=C:\
    lmsgen translat.msg Documaker xlt
    and lmsgen would write a file name "xltus.msb" to the "C:\Documaker\mesg" directory. (The msg file has a code in the first line identifying the language that it is written in, which is how it knows to name it with a suffix of "us". Documaker currently doesn't use the "ORACLE_HOME" method of locating the file, but as far as I know, you do need to have an ORACLE_HOME defined to run lmsgen.exe.
    Since we don't use the ORACLE_HOME method, you would need to provide command-line options to override input and output paths.
    lmsgen translat.msg Documaker xlt us -i .\ -o .\
    The -i identifies the input directory to location the MSG file. The -o indicates the output directory to use as a destination for the compiled MSB file.
    Finally, move the MSB and MMP file to the \dll\lang folder inside your Documaker installation.

Maybe you are looking for

  • Creative Cloud Error 205

    Hello, Yesterday I spent hours to be able to install the creative cloud application but was not successful due to 205 Error. I am downloading the installer (which is 670 Kb or something) then when I run the installer I am getting the 205 error somewh

  • LSMW for Outbound Delivery

    Hi, I am not able to find an LSMW for creating GR for outbound delivery. I tried using recording in MIGO but it did not work. Also MB1C is not working for outbound delivery. Please help. Regards, Anubhav

  • What happens with Adobe Media encoder CS6 6.0.3.1 (64 bit)

    Why Adobe Media Encoder always export (whwn queuing in Premiere) an m4v file instead an mp4 like a few days ago? Please Help!

  • Can't install Reader v9.3.0 from PSE DVD-ROM disc in Windows 7

    I recently purchased Adobe Photoshop Elements, which includes Adobe Acrobat Reader v9.3.0 on the DVD-ROM. When I first installed Photoshop Elements, I was able to successfully install Reader v9.3.0 onto my system, and it ran fine under Windows 7 Comp

  • Help! Nothing works...

    i have had my ipod nano for a week. i had it on charger and it finished charging. then all of a sudden while updating it came up with the funny little battery sign with the lightining bolt on the left? and it still has the do not disconnect sign. als