Error in reading a file:

Hello all,
I got the error below:
Exception java.io.FileNotFoundException: D:\Home$\BLOB.txt (No such file or directory)
the code is:
PreparedStatement  pSt = con.prepareStatement("insert into CLOB_COL Values(?,?)") ;
pSt.setString(1,"U");
<b>FileInputStream fis=new FileInputStream(element.getFileName()); //getting error here</b>
byte[] b= new byte[fis.available()+1];
fis.read(b);
pSt.setBytes(3,b);
pSt.execute();
pSt.close();     
Please suggest:

Pradeep,
You are getting that exception, bcz it cant find the file path.
Generally it looks for tht file in the current working directory.
You can specify the file exact location (path) like this.
FileInputStream fis=new FileInputStream("C:
Documents and Settings
user
testfile.txt");
use '
' where ever you have to use '\'.
Check this API for FileInputStream.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileInputStream.html
Regards,
Sridhar

Similar Messages

  • Error while reading wsdl file

    I created and deployed a BPEL process with a JMS adapter and DB adapter.
    I have tested this and it works fine.
    After a few days, I try to open the project and the BPEL process, and click on the DB
    adapter and it throws an exception on the designer :
    "Error while reading wsdl file ... (wsdl file name) NULL Exception"
    This is hard to debug as the exception does not provide any info, NULL.
    This has happened several times for my project. The next time the JMS adapter hit the
    same exception while opening on designer. This one I notice happened after I imported
    a new schema file (xsd) into the BPEL process.
    Only way around that I have for this currently is to delete and recreate the adapters, which as time
    consuming as I have to re-create and re-assign a lot of the activities.
    Has anyone encountered this and is there a way to fix this without deleting/recreating the adapters ?
    Thanks.

    I experienced the same issue and found the cause and a workaround;
    "Error while reading wsdl file …. Exception: null"
    http://www.petervannes.nl/files/b7c08911ce3cde3677e2182bbc5f032a-47.php
    Edited by: 944333 on Jul 3, 2012 10:24 PM

  • I do not have Microsoft office and to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?

    I do not have Microsoft office and want to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?  I am a new mac user.

    Install the free LibreOffice and save a bundle not having to pay MS. http://www.libreoffice.org/

  • Error while reading a file from server

    Mine is 9i database and 11.5.10.2 oracle apps server
    I am trying to read PDF file from server, I used the below code
    l_bfile:=bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out');
    if DBMS_LOB.FILEEXISTS(l_bfile) = 1 then
    dbms_output.put_line( 'Exists!');
    dbms_output.put_line(dbms_lob.getlength(l_bfile));
    else
    dbms_output.put_line( 'Not Exists!');
    end if;
    i used forward slashes (/) instead of backward slashes (\) too and i also made dbms_output.put_line(to_char(dbms_lob.getlength(l_bfile)));
    while using dbms_log package , i got the below error .I am bit worried since I have created directory and gave sufficicent priviliges too.
    Error report:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "SYS.DBMS_LOB", line 485
    ORA-06512: at line 24
    I am sure bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out') is give BFILE which is empty.
    Can you please suggest me what I can do to move further? what kind of priviliges it requires to point and read the file from server?
    Please help me in this.
    Thanks in advance

    I suspect you are not using a directory object is the problem.
    Here is the formal description of bfilename
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions12a.htm#SQLRF00610
    Sybrand Bakker
    Senior Oracle DBA

  • Error while reading excel file from application server into internal table.

    Hi experts,
    My requirement is to read an excel file from application server into internal table.
    Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
    Now in my program I have used :
    OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    DO.
    READ DATASET v_filename INTO wa_tab.
    The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
    Error details:
    A character set conversion is not possible.
    At the conversion of a text from codepage '4110' to codepage '4103':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported
    The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
    would have produced incorrect data.
    The number of characters that could not be displayed (and therefore not
    be converted), is 445. If this number is 0, the second error case, as
    mentioned above, has occurred.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4103' is not known to the system.
    If the conversion error occurred at read or write of  screen, the file
    name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
    the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
    Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
    Regards,
    Karthik

    Hi,
    Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    As I think you are uploading the file in BIN format to Application server and trying to open text file.
    Regards,
    Umang Mehta

  • Error while reading wsdl file exception null

    Hi
    I am trying to invoke a proxy service (web service) wsdl from a bpel process. When i add a web service adapter, put url of external web service and save it, all my service end points defined in the BPEL process are becoming non editable. Binding of operation is changing from web service to HTTP binding for all end points. When I try to edit any partner link, Jdev throws an error " error reading wsdl file excepetion null " for local services. For external service, even though i am refering to a url on the server, it points to " C:\Oracle\Middleware\jdeveloper\jdev\bin\...\xxxx?WSDL" and throws same error " failed to read wsdl file(System could not find the path specified". I am just clueless as to why this is happening. Any help is much appreciated.
    I am using Jdev 111115 and SOA 11g.

    remove all the files from your temp folder
    restart your jdev this will resolve this issue.

  • Error while reading CPS file in jar

    Hi,
    I am getting error :-
    Error while initializing CAZM Factory : CardAuthorizationManagerFactory : getFactory : in one of my class in WSAD
    Root cause i guess its not reading CPS file which is there in one of the jar file.
    Please help me to get solution.
    Regards,
    Divya

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error While Reading a file Dynamicall​y in CRIO - 9073

    Hello all,
              I am using CRIO - 9073, here i transferred a file (With size of 5mb) through FTP from my PC..... and then i am trying to read it Dynamically, but while i am reading this file and updating, my CRIO going to stop mode...... So i can't workout more... Give a fine reply all...
    Regards
    Pandithan.

    What code for path building do you have running on the CRIO?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Error while reading raw file created in previous task using raw file destination

    I am reading a flat file and creating an raw file using raw file destination.  path of the raw file is in a variable.  now I am reading the raw file using the rawfile source component. I am able to execute if the .raw file is available.  But
    when we deploy into the production the .raw will be created runtime, so the package is getting failed while evualting the variable which hold the path of the variable.  since the .raw is not available i am not able to proceed further. it's in ssis 2008
    r2
    Error at Load Data [Raw File Source [401]]: File "c:\test123.raw" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    Error at Load Data [SSIS.Pipeline]: component "Raw File Source" (401) failed validation and returned error code 0x80004005.
    Error at Load Data [SSIS.Pipeline]: One or more component failed validation.
    Error at Load Data : There were errors during task validation.

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Formatting Error While Reading Excel File using POI 2.5 Final Related

    Hi All,
    I am using poi-2.5-final-20040302.jar for my project to create excel files.
    My system is having Microsoft Excel 2002 (SP-2) version, but my client is having Microsoft Office Excel 2003 (SP-3).
    My problem is that I can download the excel file with no formatting issues , but client is not able to download the same and is getting error as
    "Damage to the file was so extensive that repairs were not possible.Excel attempted to recover your formulas and values, but some data might have been lost or corrupted".
    After getting above error message, they can open the file but the colours,fonts ie formatting will be lost and only data will be available in excel.
    Can anyone help how to sort out ths issue.
    Thanks in Advance,
    Ravi

    Sound like the Excel file is invalid... Maybe its outdated or corrupted or something. What would we know about that? POI has a mailing list.

  • Error  while  reading pdf file using adobe reader 8

    Hi ,
    I am using itextsharp for creating pdf file which contains 300 pages.
    When I tried to open that pdf file in adobe reader 5 , there is no issue . Its opening correctly. But When I 've tried to open it using adobe reader 8 . Its opening the file but I could read upto 156 pages out of 300. I couldn't read beyond that. Its displaying the following error message "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem" , "could not find the XObject named 'Xf2'." .
    Please help me to resolve the issue.
    Thanks,
    Tamil.

    Hi ,
    I am using itextsharp for creating pdf file which contains 300 pages.
    When I tried to open that pdf file in adobe reader 5 , there is no issue . Its opening correctly. But When I 've tried to open it using adobe reader 8 . Its opening the file but I could read upto 156 pages out of 300. I couldn't read beyond that. Its displaying the following error message "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem" , "could not find the XObject named 'Xf2'." .
    Please help me to resolve the issue.
    Thanks,
    Tamil.

  • Error while reading template file

    Hi,
    i have successfully created a template file from a domain(weblogic server 11.3.5).now i have to use this template file to configure a new weblogic server(11.3.5) domain.
    i have installed the new instance of weblogic server and successfully ran the WLST in off-line but when i am trying to read that template file its giving following error
    com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: com.oracle.cie.domain.ConfigRuntimeException: Required component home not found for component 'oracle.as.im.top' version '11.1.1.2.0'
    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:51)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1538)
    at com.oracle.cie.domain.script.jython.WLScriptContext.readTemplate(WLScriptContext.java:340)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyInstance.invoke(Unknown Source)
    at org.python.pycode._pyx3.readTemplate$1(/tmp/WLSTOfflineIni1669327255348009364.py:17)
    at org.python.pycode._pyx3.call_function(/tmp/WLSTOfflineIni1669327255348009364.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.pycode._pyx16.f$0(<console>:1)
    at org.python.pycode._pyx16.call_function(<console>)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyCode.call(Unknown Source)
    at org.python.core.Py.runCode(Unknown Source)
    at org.python.core.Py.exec(Unknown Source)
    at org.python.util.PythonInterpreter.exec(Unknown Source)
    at org.python.util.InteractiveInterpreter.runcode(Unknown Source)
    at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
    at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
    at weblogic.management.scripting.WLST.main(WLST.java:173)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.WLST.main(WLST.java:29)
    Caused by: com.oracle.cie.domain.script.ScriptException: com.oracle.cie.domain.ConfigRuntimeException: Required component home not found for component 'oracle.as.im.top' version '11.1.1.2.0'
    at com.oracle.cie.domain.script.ScriptExecutor.readTemplate(ScriptExecutor.java:465)
    at com.oracle.cie.domain.script.jython.WLScriptContext.readTemplate(WLScriptContext.java:332)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyInstance.invoke(Unknown Source)
    at org.python.pycode._pyx3.readTemplate$1(/tmp/WLSTOfflineIni1669327255348009364.py:18)
    ... 20 more
    Caused by: com.oracle.cie.domain.ConfigRuntimeException: Required component home not found for component 'oracle.as.im.top' version '11.1.1.2.0'
    at com.oracle.cie.domain.DomainTemplate.<init>(DomainTemplate.java:256)
    at com.oracle.cie.domain.DomainTemplate.<init>(DomainTemplate.java:182)
    at com.oracle.cie.domain.WLSTemplateBuilder.parseTemplate(WLSTemplateBuilder.java:575)
    at com.oracle.cie.domain.WLSTemplateBuilder.parseDomainTemplate(WLSTemplateBuilder.java:485)
    at com.oracle.cie.domain.WLSTemplateBuilder.buildDomainTemplate(WLSTemplateBuilder.java:1369)
    at com.oracle.cie.domain.script.ScriptExecutor.readTemplate(ScriptExecutor.java:429)
    ... 30 more
    thanks

    Hi,
    To resolve the problem do the following:
    1. Install Weblogic Server 10.3.3 in a new location.
    2. Install the OAM schema and any other required schemas from the RCU 11.1.1.3 into a unique schema name.
    3. Install the Identity and Access Management 11.1.1.3 (OAM 11g) software.
    4. Configure OAM as described in the Installation Guide:
    Oracle Fusion Middleware Installation Guide for Oracle Identity Management 11g Release 1 (11.1.1)
    http://download.oracle.com/docs/cd/E14571_01/install.1111/e12002/part2.htm#BABGDJFD
    This will help you.
    Regards,
    Kal

  • Error in Reading the file from Application Server

    Hi,
    This Error is regarding one of my interface, the issue is that , the interface reads data from file in bunch suppose 100 records at a time , then processes those records and once finished go for next 100 records .
    Noe the error is that , the process takes place till 500 records correctly but when it went to fetch for next 100 i.e fom 501 to 600 it selects only 501 to 583 .
    this records has been processed successfully but the job finished there only
    but the file contains 788 records
    When the same file has been run in other server it ran successfully without such error .
    Can you please suggest how to resolve the issue

    Hi,
    Try to manually download the file from application server using standard transactions, and than check how many records are you able to download from app. server.
    I guess there might be something wrong with the format of 583rd record, which makes sap assume that the file has come to an end.
    Hope this will help you.
    Regards,
    Vinit...

  • Getting error when reading xml file from a remote connection

    Hi all,
    I want to read an xml file from a remote connection, not from my local machine.So when i am creating the data server i am giving the host name(that is the ip of the machine where the xml file is located), giving the proper username and password and giving the path of the xml file. When i am testing the connection the error that is coming:- "Connection failed and the xml file could not be created, verify that you have write permission in the directory"...
    but read write and execute permissions have been given on the directory as well as to the file...
    Regards,
    Sourav

    Hi Sutirtha,
    Initially I have started the agent.sh giving the agent name <agent name>and port number 20910 and defined it in the topology manager it is showing that the agent test is succesful. Then I tested a particular Data server against that agent and the test was successful.
    After this we had stopped the agent and restarted it.
    However now suddenly the testing against the remote agent is failing with the following excep:
    java.lang.Exception:
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.pm.s(pm.java)
         at com.sunopsis.graphical.l.pm.g(pm.java)
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.iz.actionPerformed(iz.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog.show(Unknown Source)
         at java.awt.Component.show(Unknown Source)
         at java.awt.Component.setVisible(Unknown Source)
         at com.sunopsis.graphical.l.pm.q(pm.java)
         at com.sunopsis.graphical.l.pm.<init>(pm.java)
         at com.sunopsis.graphical.frame.b.jh.bx(jh.java)
         at com.sunopsis.graphical.frame.bo.w(bo.java)
         at com.sunopsis.graphical.frame.bo.d(bo.java)
         at com.sunopsis.graphical.frame.w.actionPerformed(w.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    PS: do i have to modify any file after or before starting the odi agent
    Thnks and Rgds,
    Sourav
    Edited by: user13263578 on Mar 15, 2011 9:35 PM
    Edited by: user13263578 on Mar 15, 2011 9:48 PM

  • HELP!! ERROR IN reading from file!! (PART of )PROGRAM

    Take a look at my program first....
    import java.io.*;
    public class reading_file {
    public static void main(String[] args) throws IOException {
    BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    String [] sType= new String[10];
    int [] sNum= new int[10];
    float [] sPrice= new float[10];
    String FileName="new.txt";
    BufferedReader inFile=new BufferedReader(new FileReader(FileName));
    String inputLine="";
    int totalLines=0;
    while(inFile.readLine()!=null){
    totalLines++;
    int totalStock=totalLines/3;
    System.out.println(totalStock);
    for(int i=0; i<totalStock;i++){
    sType=inFile.readLine();
    System.out.println(sType[i]);
    sNum[i] =Integer.parseInt(inFile.readLine());
    System.out.println(sNum[i]);
    sPrice[i] =Float.parseFloat(inFile.readLine());
    System.out.println(sPrice[i]);
    inFile.close();
    I am reading the info from the file to the respective array shown.
    e.g these are the info in the .txt file
    /////=>
    PANTS
    35
    23.3
    LOGITECH CORDLESS DESKTOP
    200
    50.23
    MONITER
    62
    54.9
    <=
    but when i run the program the errors such as :
    ==>
    compile-single:
    run-single:
    3
    null
    Exception in thread "main" java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Integer.java:415)
    at java.lang.Integer.parseInt(Integer.java:497)
    at reading_file.main(reading_file.java:26)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)
    why is that??
    any mistake in the program??

    You could mark the start of the file with the mark method from BufferedReader, but you'd best check that this is ok to do with a call to the bufferedreader markSupported method. This method will return true if you are able to mark the reader. You have to include an int parameter with the mark method that is bigger than the file size. In your case this will be easy since the file is small. Then before the second reading, call reset( ) on your buffered reader.
    Personally, I wouldn't use arrays but would use an arraylist. Also, I'd have the 3 bits of information entered into a single object and store all the information (contained within the single object) into a single arraylist. Since the arraylist has a variable size, you don't need to know its size in advance, and you don't have to worry about reading through a file twice. Once will do nicely.

Maybe you are looking for

  • How can batch field in Purchase Order(PO) be a fixed value????

    Hi Experts, In SAP, when create a purchase order, there is a field "Batch" for every item, which means "Assigns a material that is manufactured in batches or production lots to a specific batch ". For some special reasons, we want for some certain ma

  • Installing both Oracle 9iDB and Developer6i

    I'm trying to install both Oracle 9i Database and Developer 6i but it doesn't work! The Database works fine but the Forms Builder, for example, doesn't want to connect to the database I've created when installing the Database 9i. I get the following

  • Cc error code 100c

    I am trying to use system restore to restore it to factory specs. I keep getting an error code 100c and it will not finish the restore and just restarts the computer. What do i do to get it to restore, i tried the recovery discs but it didn't work an

  • Installation errors encountered MAC OS

    Photoshop Element installed without error Premiere Element failed miserably...any suggestions for a non sophisticated computer user Exit Code 7 8 errors and 7 warnings Warning DW031 payload camera profiles patch.   Uninstalled Adobe 6.4 Error DW006 A

  • How can I download all messages in my inbox to a CD?

    I want to download my entire inbox to a CD. There are >600 messages, so I cannot do them one at a time. Is there a bulk way to do it?