How will read the property file on dynamically?

hi,
I developed 2 java files...in both the files i am reading the some content from .property file(Notes.properties)....
I created the jar file call Aix.jar using the following command.
jar -cvf Aix.jar *.class(without specifying the notes.properties file)...
then i executed the java file using the folowing command
java -cp Notes.jar;Aix.jar NotesToolTest
now i am getting following exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.util.MissingResourceException: Can't find bundle for base name Notes, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at NotesToolTest.<clinit>(NotesToolTest.java:28)
I got the problem why this happening...because notes.properties is not included in jar file...that's why the above exception is coming.
But my problem is can i run the java file that will take .prooperties file dynamically(if .property is available on the current directory)...
Thanks in advance,,,,
Regards,
Sankar

because notes.properties is not included in jar file..Wrong. It is simply not available in the classpath.
The solution is either putting the properties file in the classpath of JVM used, or adding the system path to the propertiesfile to the classpath of the JAR.

Similar Messages

  • How to read the properties file available in Server File structure in webdy

    hi all,
    I have developed one webdynpro application. In this application i need to access mdm server to continue. For getting the connection i need to pass the IP addresses.
    Can i have code  how to read the properties file which is residing in the server file. with out included along with the application. keeping some where in the file structure in the server. I want to read that properties file by  maintain the iP addresses and users in  properties file based on the key i want to read like below.
    servername="abcServer"
    username="john"
    password="test123"
    Please send me the code how to read this properties file from the file structure and how to read this values by key  in webdynpro application
    Regards
    Vijay

    Hi Vijay,
    You can try this piece of code too:
    Properties props = new Properties();
    //try retrieve data from file
    //catch exception in case properties file does not exist
    try {
             props.load(new FileInputStream("c:\property\Test.properties")); //File location
             String serverName = props.getProperty("servername"); //Similarly, you can access the other properties
             if(serverName==null)
               //....do appropriate handling
         }     catch(IOException e)
                   e.printStackTrace();
    Regards,
    Alka.

  • How to add the property file..ie(default.properties) to a webdynpro project

    Hi All,
    How to add the property file..ie(default.properties) to a webdynpro project.
    I urgently require the solution. Kindly get it for me.
    Regards
    DK

    Hi DK,
    this is described in the second Web Dynpro Java Tutorial
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b1a3e990-0201-0010-aeb2-a2ef5bc3da8e">creating an Extended Web Dynpro Application</a>
    Regards, Bertram

  • In Vista,  Applet isn�t able to read the property files

    I�m working on internationalization; the Applet which I�m using wasn�t able to read the property files properly in windows Vista machine. But if I create a jar which contains all the classes and property files, Applet works fine.
    This problem is only in Vista machine ,In XP the JVM is smart enough to read plain .property files and its works well without creating the jar
    Is that related to any security enhancemence of vista over XP?
    Below is a link about The Java Security Model break on Windows Vista
    http://bugs.sun.com/view_bug.do?bug_id=6548078
    I tried a simple ResourceBundle.getBundle() in my Applet in different ways but nothing work fine for me. It isn�t an issue related to path, I guess because I tried several ways like.
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle",currentLocale);
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle",currentLocale);The exception got in java console is
    CONFIG: [2008-05-13 15:54:57.909]:(com.satm.insite.InsiteApplet$2@1696e4c):InisiteApplet: Exception:  java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
    java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
                at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
                at java.util.ResourceBundle.getBundleImpl(Unknown Source)
                at java.util.ResourceBundle.getBundle(Unknown Source)
                at com.satm.insite.InsiteApplet.displayValue(InsiteApplet.java:261)
                at com.satm.insite.InsiteApplet.callme(InsiteApplet.java:296)
                at com.satm.insite.InsiteApplet.initialize(InsiteApplet.java:327)
                at com.satm.insite.InsiteApplet$2.run(InsiteApplet.java:235)
                at com.satm.tools.languageTools.ThreadPool$ExceptionCatchingThread.run(ThreadPool.java:226)Is there any way to make it work in Windows Vista machine�? This could be a great help for me.
    Thanks
    Robert

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=5295743&messageID=10250558#10250558
    http://forum.java.sun.com/thread.jspa?threadID=5295742&messageID=10250556#10250556

  • How to read the backup file of my own iphone...

    how to read the backup file of my own iphone... becase I'm running out of space in my iphone so  need to delete some photos. I wanna know do i have to copy photos to my computer or is it available in the back up file ????

    Always move (copy and delete) your photos from Camera Roll to your computer.
    Camera Roll is the digital camera card.

  • How XI will read the .txt file

    Experts,
    i AM WORKING ON A FILE BAPI synchrounous scenario.
    Sender will drop the required file on XI directory and XI will pull the file and map it with the BAPI u2013 and crate services  entries in SAP SCM. If errors are encountered during the process they are returned to the client in a report or as erroneous file.
       *I have a .txt file( tab delimitted file)  in the folowing structure
    H                       NAME                        date            ***                 data_txt                         676869*
      C             a                           b             c
      C             d                           e             f
    H                      name                           Account            brat                     abcc                             12333
      C             a                             b               c
      C             d                             e               f                          hjhdkf
    like this  multiple entries, ll be getting .
    Based on H ( indicator), Have to get the data. How will I do in XI file  adapter?  Please help me how should I design the file adapter so that It can read the .txt file.
    I have created the sender data type similarly to the structure of BAPI.
    Note; H indicates teh Header and D indicates teh sublines. Together it is called one service entry. Aagain Next 'H' indicates the strat of next service entry.
    Thanks
    Veeru

    Nutan,
      I want the flat file  data in teh following xml format
    <Records>
        <Header>
             <Item>
                    <data1>1</data1>
                    <data2>2</data2>
              </item>
       </header>
    <Header1>
             <Item>
                    <data1>1</data1>
                    <data2>2</data2>
              </item>
       </header1>
    </Records>
    Records-- o to unbounded
    Header--- 0 to 1
    header1-- 0 to 1
    Item--- 0 to unbounded
    My input .txt file ,  fields are separated by a tab. I mean its a tab delimitted file.
    The main tag Records is 0 to unbounded.
    How to do the content conversion for the  same.
    Thanks
    Veeru
    Edited by: viru srivastava on Dec 20, 2009 2:56 AM

  • How to read the text file present in the Al11 server through our program?

    My requirement is that , i have one file already present in the AL11 server. Now i want to take this file so that I can read this file .
    So will you please help me , how to read the file from AL11 server in our program ?
    Thankx in advance

    Hi..
    I too agree to the above post .. SEARCH in SCN before posting..
      DATA: lv_filename  TYPE string, "File name
            lv_line      TYPE string. "One line entry in a file
      lv_filename = iv_file_name.
      IF iv_location = gc_application.
        IF iv_record_count IS SUPPLIED.
      Open file
          IF gv_file IS INITIAL.
            OPEN DATASET lv_filename FOR INPUT IN TEXT MODE
                                     ENCODING DEFAULT.
                                     ENCODING DEFAULT
                                     IGNORING CONVERSION ERRORS.
            IF sy-subrc <> 0.
              RAISE file_open_error.
            ENDIF.
            gv_file = gc_check.
          ENDIF.
      Read data
          DO iv_record_count TIMES.
            READ DATASET lv_filename INTO lv_line.
            IF sy-subrc <> 0.
      Close file
              CLOSE DATASET lv_filename.
              IF sy-subrc NE 0.
                RAISE file_close_error.
              ENDIF.
              CLEAR gv_file.
    Exit from the loop
              EXIT.
            ENDIF.
    Regards
    Ansari

  • How to read the AFP file in hex format

    hi,
    I am reading a AFP file in hexstring format.But it is out put is not perfect means it is showing output close to the real one.
    How to read the file so taht i can get exact output in hex format.
    try{         
                        File inputFile = new File( "C:\\ACode\\afpfile.afp" ) ;
                        File outputFilehex = new File ( "C:\\ACode\\Hex.txt" ) ;
                        FileInputStream inputStream = new FileInputStream( inputFile );
                        Reader in = new InputStreamReader(inputStream,"Cp1252");
                        BufferedReader readableFile = new BufferedReader( in ) ;
                        FileOutputStream outputStreamhex = new FileOutputStream( outputFilehex );
                        Writer outhex = new OutputStreamWriter(outputStreamhex);
                        BufferedWriter writableFilehex = new BufferedWriter( outhex ) ;
         int line;
         String hext=new String();
         while ((line= (readableFile.read()))!=-1)
              writableFilehex.write(Integer.toHexString(line).toUpperCase());
         } writableFilehex.close() ;
    readableFile.close() ;
    catch( IOException e ) {
         System.out.println( e.getMessage() ) ;
         

    while reading i am getting most of hex charters are same except some places like instead of taking 00 its writing 0 and instead of f8 its writing fff.
    AFP is a IBM format for printing. Somehow i will be able to read that but how to covert it back to that format and store to that file.
    by trying is just storing data in hex format only
    Writer outhex = new OutputStreamWriter(outputStreamhex,"Cp1252");
    is there anyother way to store it back to this format

  • How to read the iak file in visual c#

    I am trying to read the iak file from visual c#.  How to parse the file?
    I need to know how and what information is stored in the file.
    Why?
    We have Fieldpoints and every time we are moving them around, or the eqjuipment connected to them.  Every time we have to go back and update the program reading the data from the Filedpoints.  If the program can read the iak file, it will be better.

    AlbertJ,
    With the Microsoft .NET Framework version 1.1 or later, you can
    use NI-VISA to create applications using Visual C# and Visual Basic .NET without
    Measurement Studio. You need Microsoft Visual Studio .NET 2003 for the API
    documentation to be installed.
    The installed documentation contains the NI-VISA API overview and
    function reference. This help is fully integrated into the Visual Studio .NET
    documentation. To view the VISA .NET documentation, go to
    Start»Programs»National Instruments»VISA»NI-VISA .NET Framework 1.1
    Help. Expand NI Measurement Studio Help»NI Measurement Studio
    .NET Class Library»Reference»NationalInstruments.VisaNS to view the
    function reference. Expand NI Measurement Studio Help»NI Measurement
    Studio .NET Class Library»Using the Measurement Studio .NET Class
    Libraries»Using the Measurement Studio VisaNS .NET Library to view
    conceptual topics for using NI-VISA with Visual C# and Visual Basic .NET.
    To get to the same help topics from within Visual Studio .NET
    2003, go to Help»Contents. Select Measurement
    Studio from the Filtered By drop-down list and follow
    the previous instructions.Examples can be found at C:\Program Files\National Instruments\MeasurementStudio(version #)\DotNET\Examples\Visa. These examples are installed when you install the VISA driver with .NET support.
    Test Engineer - CTA

  • How to Read the "text file and csv file" through powershell Scripts

    Hi All
    i need to add a multiple users in a particular Group through powershell Script how to read the text and CSV files in powershell
    am completly new to Powershell scripts any one pls respond ASAP.with step by step process pls
    Regards:
    Rajeshreddy.k

    Hi Rajeshreddy.k,
    To add multiple users to one group, I wouldn't use a .csv file since the only value you need from a list is the users to be added.
    To start create a list of users that should be added to the group, import this list in a variable called $users, the group distinguishedName in a variable called $Group and simply call the ActiveDirectory cmdlet Add-GroupMember.
    $Users = Get-Content -Path 'C:\ListOfUsernames.txt'
    $Group = 'CN=MyGroup,OU=MyOrg,DC=domain,DC=lcl'
    Add-ADGroupMember -Identity $Group -Members $Users

  • How to read a property file..urgent

    Hi ,
    This is kinda urgent if you can help! I am a new bee to servlet and java.
    My JSP calls a java class file. In the class file i establish my connection to database.
    My requirement is to read a property file for the database name, username and password and connet to the database using JDBC(database is oracle).
    which class to use. I know something about properties class. Is there any other class which can read my property file.
    Or is there any other all together a better way to do it.
    thanks in advance
    Amit

    Inside your WAR file somewhere under the WEB-INF directory. This space is protected, whereas the ROOT (of course) is not. Unless you would like someone else to read your properties file...
    Once you decide where you want it, post the section of code where you load the properties file, we can probably help you figure out where you path is wrong.

  • How to Read the Source file instead of Dummy file

    Hi All
    We have LSMW in that they are Reading Dummy file instead of the Source file ...
    But my requirement is, i want to read the source file in specify file step in stead of Dummy file,
    how to do this ? can any one help me on this
    Regards
    Smitha

    Never heared that dummy files are used anywhere in LSMW.
    Exchange the file in step 7 Spcify files to the file of your choice.

  • How to configure the property file

    Is this the correct way of configuring the property file in web.xml.
    <servlet>
    <servlet-name>ControllerServlet</servlet-name>
    <servlet-class>com.test.prod.pds.Controller</servlet-class>
    <init-param>
    <param-name>LOGINID</param-name>
    <param-value>C:\bea\user_projects\domains\mydomain\applications\TestWebApp\WEB-INF\classes\loginid.properties</param-value>
    <description>Pds Group properties file</description>
    </init-param>
    </servlet>
    IT is giving an error "javax.servlet.ServletException: loginid.properties (The system cannot find the file specified)"

    Hi,
    Place that properties file in the application classpath Then it will work fine without any problems.
    Go through the follwing links,In that you will get usefull information on this.
    http://jtidy.sourceforge.net/multiproject/jtidyservlet/configuration.html
    http://www.utdallas.edu/~baughman/velocity4.html
    Regards
    Anilkumar kari

  • How to read the CSV Files into Database Table

    Hi
    Friends i have a Table called tblstudent this has the following fields Student ID, StudentName ,Class,Father_Name, Mother_Name.
    Now i have a CSV File with 1500 records with all These Fields. Now in my Program there is a need for me to read all these Records into this Table tblstudent.
    Note: I have got already 2000 records in the Table tblstudent now i would like to read all these CSV File records into the Table tblstudent.
    Please give me some examples to do this
    Thank your for your service
    Cheers
    Jofin

    1) Read the CSV file line by line using BufferedReader.
    2) Convert each line (record) to a List and add it to a parent List. If you know the columns before, you might use a List of DTO's.
    3) Finally save the two-dimensional List or the List of DTO's into the datatable using plain JDBC or any kind of ORM (Hibernate and so on).
    This article contains some useful code snippets to parse a CSV: http://balusc.xs4all.nl/srv/dev-jep-csv.html

  • SAP GRC - Exporting rules from GRC - how to read the .txt file generated ?

    Hi there,
    I am using GRC Compliance Calibrator and have downloaded the default Global rules defined in Compliance Calibrator using the Rule Architect -> Utilities->Export rules.
    This gave me a massive txt file with a lot of tables and data. Reading through this forum, I did figure out that lines starting with M are the header rows for the tables and D rows are the data rows.
    My question is, how do i figure out what each of the Virsa tables stand for (e.g. VIRSA_CC_FUNCACT, VIRSA_CC_FUNCPRM) ?
    I tried SE11 and looking up these tables in the SAP environment associated with this CC install, however it says that the table was not found.
    Could someone please point me to :
    A) A list of the common Virsa CC tables and their descriptions ?
    OR
    B) How can i find what these tables stand for online or in the SAP environment?
    Many thanks !

    Hi Santosh,
    There is no option available to export only the customized rule sets to another system. The export rules option will give all the rules that are available in that system.
    You can do in the below manner
    a) Extract the data from Export rules
    b) Open that text file in a spreadsheet and edit the spreadsheet [Remove the rule sets & the rules not required in production system]
    c) Save the spreadsheet in UTF-8 text file
    d) Upload them in the production.
    The above procedure is bit complex and cumbersome -as changing the text file is risky. Even a space will not generate any rules in the RAR. I would suggest rename the new rule set in different naming convention and upload in your test environment before uploading the text files  in Production.
    But, using the Export and Import option you cannot upload only the customized rule set as the extract happens for the entire rules sets available in the system.
    Thanks and Best Regards,
    Srihari.K

Maybe you are looking for