Unable to close file handle

Hi all,
i am writing a tiff to jpeg converter and it works so far.
the only problem that i have is, that as long as my application is not closed, i can not modify the newly created jpg files (like renaming them or something)
as i have read in another thread, the problem is the usage of JAI.create. i am not sure how to change my code though. please help me ~
here is the portion of my code that does the conversion.
RenderedOp op = JAI.create("fileload", path);
JPEGEncodeParam encodeParam = new JPEGEncodeParam();
encodeParam.setQuality(0.8f);
ParameterBlock pbSave = new ParameterBlock();
pbSave.addSource(op);
pbSave.add(destFile).add("JPEG").add(encodeParam);
JAI.create("filestore", pbSave);

This is a bug that is supposedly fixed in JAI 1.1.3. I'm not sure if ever was fixed though.
Both the fileload and filestore operations open streams which are never closed until finalized (i.e. garbage collected). In the fileload case, the problem is do to the deferred loading nature of JAI where a RenderedOp is not loaded until a method is actually called on it. So the stream is kept around until then. In the filestore case, it's a genuine bug.
The workaround is to append the following to that code snippet of yours:
JAI.create("filestore",pbSave);
pbSave = null; op = null;
System.gc();The garbage collector will (hopefully) run, and finalize the streams. The close() method will subsequently be called on the streams within the finalize() method.

Similar Messages

  • Hello! I use photoshop CS3. recently, after logging information into FILE INFO, I am unable to close out that window. I am able to save & close the image I am working on, but the window remains. I then must close out of Photoshop completely and reopen to

    Hello! I use Photoshop CS3 and Yosemite. Recently, after logging info information into the FILE INFO panel, I am unable to close out the window. I am able to save & close out the image, but then I have to completely close Photoshop and re-open the program to work on a new image. Frustrating! Any help to remedy this problem? Many thanks!

    Try resetting the Photoshop preference file: Press and hold Cmd+Opt+Shift and start Photoshop. Select "yes" when asked if you would like to continue with reset.
    Benjamin

  • ORA-27045: unable to close the file

    I have found distinct ora error in alert log file, i can rectify what this error is all about
    Thu Jan 17 00:18:58 2008
    Errors in file /oracle/BP3/saptrace/usertrace/bp3_ora_13476.trc:
    ORA-27045: unable to close the file
    SVR4 Error: 5: I/O error
    TRACE FILE INFO
    Dump file /oracle/BP3/saptrace/usertrace/bp3_ora_13476.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning and Data Mining options
    ORACLE_HOME = /oracle/BP3/102_64
    System name: SunOS
    Node name: DSS-BWDB
    Release: 5.10
    Version: Generic_120011-14
    Machine: sun4u
    Instance name: BP3
    Redo thread mounted by this instance: 1
    Oracle process number: 168
    Unix process pid: 13476, image: oracle@DSS-BWDB (TNS V1-V3)
    *** 2008-01-17 00:18:58.417
    *** SERVICE NAME:() 2008-01-17 00:18:58.391
    *** SESSION ID:(698.4119) 2008-01-17 00:18:58.391
    ORA-27045: unable to close the file
    SVR4 Error: 5: I/O error
    Additional information: 3
    Can anyone what is wrong, is this a fatal error?
    Thanks
    Jafar

    This is an OS related error, particularly IO. This could be a damaged disk sector or a disk array failure. You should proceed with caution and have your backup handy. Please check OS physical storage health.
    ~ Madrid

  • ~QOCIResult: unable to free statement handle

    Good morning
    I have a problem with an application. First of all I use oracle db 10 and qt 4.6 with c++ and I have written this code:
    void DBConnector::releaseConnection(const dbConnection& dbc)
            QMutexLocker locker(&mt_connections);
            QString conn_id = dbc.getId();    //here I obtain my connection name
            cout << "Release Connection: " << qPrintable(conn_id) << endl;
            QSqlDatabase myDB = QSqlDatabase::database( conn_id );
            myDB.close();
            QSqlDatabase::removeDatabase( conn_id );
    }The code compiles and works but it returns a warning: ~QOCIResult: unable to free statement handle
    So I've lost two days to understand where the problem is but I wasn't able to find a solution. I've also opened the qsql_oci.cpp file and I've found this:
    QOCIResult::~QOCIResult()
        if (d->sql) {
            int r = OCIHandleFree(d->sql, OCI_HTYPE_STMT);
            if (r != 0)
                qWarning("~QOCIResult: unable to free statement handle");
        delete d;
    }I think the problem is in the OCIHandleFree method. Do you know how to solve it? Is this a bug between qt and oracle?
    Thanks

    If there's a problem between a 3rd party product and Oracle,you better consult the 3rd party (because the 3rd party vendor prepares the API).
    Werner

  • New inst: HP-UX: db2icrt fails: CLP frontend unable to get request handle

    We are migrating our installations from the beautiful AIX to ... HP-UX.  I am told I will learn to love it, but probably not until they update df to at least 1988 levels. 
    This is the pilot install.  We have never seen this work before (and maybe no-one has...?)
    sapinst runs correctly up to the "Create database instance" phase.  At that point it dies with the following:
    FUNCTION: DB2 UDB, command line process, clp_start_bp, probe:3
    MESSAGE  : CLP frontend unable to get REQUEST handle
    DATA #1: Hexdump etc.
    DBI1281E: The database manager configuration file could not be read initialized.
    No further useful information is provided.
    In db2<sid> I have a bunch of dot files (.profile and the like) and the db2_software directory containing the database installation.
    During the create database instance phase, I can see that directory sqllib is created, but it is deleted when the phase fails.
    There is no litter of any kind in the /db2/<SID> directories, - nothing has been done at all.
    I have done the following: <<imagine nice bullets below - they dont seem to be available here>>
    checked that the permissions on /tmp and the installation direcctory (redirected by setenv  TEMP  /usr/sap/install) are 777: they are;
    checked the OS parameters with db2osconf - they are good
    checked the host name resolution with a perl script - gethostbyname and gethostbyaddr agree.
    the ip address, simple hostname and FQDN are on a line in the hosts file
    there is no litter from previous installations - this is a clean machine
    I could not find any reference to required environment variables (such as LD_LIBRARY_PATH) in the install guide or the install note - so I have not set any.
    I have been hacking away at this for days.  I have put in a call to SAP, who will get back to me after dark (of course...)
    This seems to be a massively popular problem, and the helpful error message ("Sorry, Sport, just can't bring myself to do it") seems to have people jumping from tall buildings and in front of busses all over Google-world.  Furthermore there also seems to be a near-infinite number of possible causes and none of them seem to apply here.
    H-PUX version is 11.31.  DB2 is 9V5 patch 4.  sapinst is latest available.  Weekend is fading fast...
    Edited by: Russell Day on Mar 5, 2010 7:46 AM

    >
    Paul Power wrote:
    > Hi Russell,
    >
    > Apologies if some of this has been already tried but please check the following points:
    >
    > Make sure the machine name is listed in its hosts file.
    >
    > Make sure to log on directly to root. ie: do not su to root from another without '-'        
    >
    > Make sure there is no instance created already (find / -name sqllib) for that user 
    >
    > Using ps -aef and ipc -a, no old db2 ressources should be displayed for db2 instance owner. If there are any, kill/remove it  
    >
    > You should make sure, that LIBPATH and LD_LIBRARY_PATH of root and db2 instance owner does not point to an path of another db2 version
    >
    > Regards,
    > Paul
    No need to apologise for assisting, Paul, but I have dealt with most of these.
    The host file contains the unqualified and fully qualified hostnames, on the same line, unqualified first.
    I am logging in as root (because there were no other users, and I'm old school, from when everyone logged on as root to do everything.
    There is no instance, and in fact there is no sqllib except when the "create database instance" step is running.
    The only detectable db2 process running is db2fcmd
    I have not been able to find any instructions regarding LD_LIBRARY_PATH and LIBPATH for HP-UX.  They are not mentioned in the installation guide at all.  I cannot find it in any of the installation notes.   I presume sapinst is setting them itself before they are needed.  Neither are set in the enviroment of db2<sid> or <sid>adm.  I have gnawed my fingernails to the elbow over this one, but I cannot see any indication that either should be set for HP-UX.  Anyway, they are definitely not set anywhere, to anything.  This was a clean machine before I started chopping it up to do this install.
    I figure it must be complicated - I have been trying to get an answer for 10 days already.  I will absolutely hate myself when it turns out to be something obvious, documented in 10 places, mostly in bold italics.  I shoulda taken my dads advice and been a riverboat gambler or a piano player in a cathouse - its a lot less complicated,

  • Can't delete file after renaming due to Word file handle still present. Error staes document is still in use but it's really not. Worked fine in 2007 but not in 2010.

    I have some code associated with a Word Template. The template is opened, filled out and saved via a routing in vba. This all works fine in older 2007 version (which is version it was originally created in). Once this file is saved, the user can change the
    date in a text box and re-save document. The code saves using the new date for part of new file name and then deletes that older file from the server. It fails at the delete function because the newer version of word is not dropping the file handle from the
    first named file when user saves it to the new filename. In older version (2007) this handle was released as soon as file was saved to a different name. I can't seem to figure out how to release the old document filename so the old document file can be deleted.
    I hope I explained this well enough.
    Here's the code that woeked in version 2007 but fails in version 2010.
    Option Explicit
    Dim CAPEX01 As MSForms.ComboBox
    Dim CAPEX02 As MSForms.ComboBox
    Dim LocalPath As String
    Dim NetPath As String
    Dim OldPath As String
    Dim OldPathNet As String
    Dim DocName01 As String
    Dim DocName02 As String
    Dim DocName03 As String
    Dim DocName04 As String
    Dim DocName As String
    Dim DocNameold As String
    Dim TestDocName As String
    Dim filesys
    Dim newfolder
    Sub AutoOpen()
    ActiveDocument.ActiveWindow.View.Type = wdPrintView
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
    End Sub
    Sub AutoNew()
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
     ComboBox1.Locked = False
     ComboBox1.Enabled = True
     FillList1
     FillList2
     End Sub
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
        If Not TestDocName = DocName01 Then
            Set filesys = CreateObject("Scripting.FileSystemObject")
        If filesys.FileExists(DocNameold) Then
            filesys.DeleteFile (DocNameold), True      
     'I get file permission error here
        End If
        End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
        MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    '''''''Document path functions''''''
    Sub chkpath()
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If Not filesys.FolderExists("\\yourPath\") Then
       newfolder = filesys.CreateFolder("\\yourPath\")
    End If
    If Not filesys.FolderExists("\\yourPath\" & DocName01 & "\") Then
        newfolder = filesys.CreateFolder("\\yourPath\" & DocName01 & "\")
    End If
    End Sub
    ''''''Save Function''''''
    Private Sub CommandButton1_Click()
    DocName01 = ActiveDocument.TextBox2
    DocName02 = ActiveDocument.TextBox4
    DocName03 = ActiveDocument.TextBox1
    DocName04 = ActiveDocument.ComboBox1.Value
    chkpath
    NetPath = "\\yourPath\" & DocName01 & "\"
    DocName = NetPath & DocName01 & "-" & DocName02 & "-" & DocName03 & "-" & DocName04
    ActiveDocument.SaveAs2 FileName:=DocName, FileFormat:=wdFormatDocument
     ComboBox1.Locked = True
     ComboBox1.Enabled = False
     ComboBox2.Locked = True
     ComboBox2.Enabled = False
     TextBox1.Locked = True
     TextBox1.Enabled = False
     TextBox3.Locked = True
     TextBox3.Enabled = False
     TextBox4.Locked = True
     TextBox4.Enabled = False
     DeleteOldDoc
    End Sub
    Sub FillList1()
    Set CAPEX02 = ActiveDocument.ComboBox2
      With CAPEX02
          .AddItem "CASTING", 0
          .AddItem "HOT ROLLING", 1
          .AddItem "COLD ROLLING", 2
          .AddItem "FINISHING", 3
          .AddItem "PLANT GENERAL", 4
          .AddItem "MOBILE EQUIPMENT", 5
      End With
    End Sub
     Sub FillList2()
     Set CAPEX01 = ActiveDocument.ComboBox1
      With CAPEX01
          .AddItem "A Name", 0
          .AddItem "Another Name", 1
      End With
    End Sub
    Private Sub CommandButton2_Click()
        UserForm1.Show
    End Sub

    mogulman52 and Don,
    I went back and looked at my code and had already updated it to SaveAs in the new docx format. It still holds the lock handle in place until Word closes, unlike earlier versions which released the lock handle when you did a SaveAs.
    As a note, all my Word and Excel macro-enabled (dotm & xltm) templates are read only and are never filled in, prompting the user for a file name on any close event or if they run the code gets auto-named. I do the SaveAs and concatenate the file name
    from data on the document (or sheet) that has been filled in. During the SaveAs the docx gets saved to a network folder and also on a local folder. The lock gets renamed to the filename and remains until Word is closed.
    So my code still fails at the point noted below while trying to delete an old filename version after the file has been saved as a new filename in a new folder. So....
    The code is looking in the last folder where the docx file was saved for the older filename so it can be deleted. The newest docx version has already been saved in a different folder and has a new lock handle of its own. That lock is not my problem, it's
    the older file lock which really exists in the same folder as the first filename that the docx was saved to. It does not release that lock until I exit Word. My work around has been to instruct all users to manually delete the older version file.
    The other odd thing is this only happens when I run it from code, if you manually go through these steps with the SaveAs menu drop-downs in Word it will release the lock handle???
    Hope this isn't to confusing and thanks for all your suggestions and help.
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
    If Not TestDocName = DocName01 Then
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FileExists(DocNameold) Then
    filesys.DeleteFile (DocNameold), True 'I get file permission error here- lock handle is still present from last SaveAs command in last folder where previous version of file was saved.
    End If
    End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
    MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    Glenn

  • Unable to close some custom forms

    Hi Gurus,
    We did application migration from Hp-Unix to Sun Solaris. Oracle apps 11.5.10.2 with database 10.2.0.4 and application working good with few issues.
    Issues:
    1. Few custom forms ( message Forms) unable to close. If we close by clicking X mark on top right corner, it does not close can just minimise.
    2. Couple of Custom forms does not open even we have .fmx in the custom folder.
    Need some suggestions on this issues.
    Thank You.

    f60gen module=ARXCUDCI.fmb userid=apps/apps output_file=/ul01/app/applmgr/lasrx/au/11.5.0/forms/US/ARXCUDCI.fmx
    Compiling ON-DELETE trigger on CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-BUTTON-PRESSED trigger on BP_CLOSE item in CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-NEW-ITEM-INSTANCE trigger on CURRENT_RECORD_INDICATOR item in CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-MOUSE-UP trigger in FOLDER_PROMPT_MULTIROW property class...
    No compilation errors.
    Compiling WHEN-BUTTON-PRESSED trigger in FOLDER_OPEN property class...
    No compilation errors.
    Created form file /ul01/app/applmgr/lasrx/au/11.5.0/forms/US/ARXCUDCI.fmx
    Thanks You.

  • Unable to close Safari windows

    I am unable to close any windows in Safari.
    I am able to expand and minimize them.
    I had been unable to open Safari which I resolved by removing the Safari preferences file and have tried repeating this as well as resetting Safari and running general maintenance proceedures such as permissions, scripts, etc. with no success.
    Is it possible to reinstall just Safari ( mine is version 2.03) or can this only be done through a system update?
    Thanks for your help!
    733 MHz Power PC G4   Mac OS X (10.4)  

    After attempting various fixes and several unsuccessful attempts at using the 10.4.7 combo updater I was finally able to update to 10.4.7 from my Tech Tool eDrive.
    Somewhere along this process, I think after the System update, my window problem was resolved.
    Thanks.
    733 MHz Power PC G4   Mac OS X (10.4)  

  • Unable to Close the book in Firefox

    Hi,
    I am Unable to Close the book in Firefox when WebHelp Pro
    application is opened through the robo server 7. When i open the
    help application all the books will be opened and they cannot be
    closed by clicking on them. But if i open the same file i.e.,
    projectname.htm directly inside the program
    file/adobe/roboserver..... it opens fine with all the books closed
    and can be opened on click.
    Adding to this each contextual call to the WebHelp pro is
    opening in a new window in Firefox 2.0.0.12. But all these works
    fine with ie7. Can anybody help me out in this regard?
    Thanks,
    Arun

    This sounds pretty similar to an issue that I am
    experiencing.
    Basically in IE5 on Windows 2000, IE6 and IE7 on Windows XP,
    the table of contents appear as required - all books are not
    expanded, and once the user clicks on a book, the book is expanded.
    However in IE7 in Windows Vista and in Firefox on all Windows
    platforms, the table of contents appears with all books expanded,
    and when clicking on a book, the book will not collapse.
    However if the same page is directly navigated to (e.g.
    http://servername.com/dir1/index.htm)
    the table of contents appears correctly (all books collapsed and
    users able to expand and collapse a book by clicking on it).

  • Unable To Include Files In iOS Package

    Hi,
    I an using the latest release version of Flash Builder, trying to package an app for the iPad. I have an AIR application that I created to run on a desktop, and have modified it to run on the iPad. It works fine, however I cannot package the need resource files it uses, such as jpg, xml, swf, and flv files within the ipa file using Flash Builder. It seems that if I select more than 30-40 of these types of files to include, Flash Builder will not compile the ipa file without some sort of error, the most common one talks about:
    "Cannot run program "java.exe" (in directory "C\Users\lee\AppData\Local\Temp\AOT1308010984915"): CreateProcess error=206, The filename or extension is too long"
    Now I am guessing that Flash Builder is appending all of my selected files to a command line string or something somewhere, and so it can't handle that long of string on the command line. If I stick to less than 30 files, it works fine, but if I try and the 1000 or so files that I need to, it will not work.
    This app would never be in the app store, but rather on internal company iPads. The reason for so many files is the number of products the app covers, and the number of languages it supports. So yes the ipa file would be about 500Mb, but that should not be an issue, since an ipa file is basically a zipped archive. I think this is a bug though in Flash Builder; the program also becomes unresponsive when trying to access the include file list located in Project Properties -> ActionScript Build Packaging -> Apple iOS settings dialog. It make take several minutes before FB becomes responsive again when working with this number of files.
    Does anyone have any suggestions?
    thanks

    Hello,
    Since I first encountered this bug, I have always had my asset files in
    subfolders. See the attached screen shot. This is my project folder, and
    every subfolder is included except for the com folder, which for some
    reason FB copied into the bin directory on it's own.
    So I do not think this fixed. In this report, they are not using the same
    number of files as I am, so it is possible that this only works with a low
    number of files.
    thx
    Anirudh Sasikumar <[email protected]>
    06/23/2011 01:26 AM
    Please respond to
    [email protected]
    To
    Keith Lee <[email protected]>
    cc
    Subject
    Unable To Include Files In iOS Package
    Caterpillar: Confidential Green Retain Until: 07/23/2011
    Here is the bug: https://bugs.adobe.com/jira/browse/FB-31616
    The comments seem to indicate that if you put your files in a subfolder
    rather than directly in src, it should work.
    Let us know how it goes.
    -Anirudh

  • Duplicate File Handling Issues - Sender File Adapter - SAP PO 7.31 - Single Stack

    Hi All,
    We have a requirement to avoid processing of duplicate files. Our system is PI 7.31 Enh. Pack 1 SP 23. I tried using the 'Duplicate File Handling' feature in Sender File Adapter but things are not working out as expected. I processed same file again and again and PO is creating successful messages everytime rather than generating alerts/warnings or deactivating the channel.
    I went through the link  Michal's PI tips: Duplicate handling in file adapter - 7.31  . I have maintained similar setting but unable to get the functionality achieved. Is there anything I am missing or any setting that is required apart from the Duplicate file handling check box and a threshold count??
    Any help will be highly appreciated.
    Thanks,
    Abhishek

    Hello Sarvjeet,
    I'd to write a UDF in message mapping to identify duplicate files and throw an exception. In my case, I had to compare with the file load directory (source directory) with the archive directory to identify whether the new file is a duplicate or not. I'm not sure if this is the same case with you. See if below helps: (I used parameterized mapping to input the file locations in integration directory rather than hard-coding it in the mapping)
    AbstractTrace trace;
        trace = container.getTrace();
        double archiveFileSize = 0;
        double newFileSizeDouble = Double.parseDouble(newFileSize);
        String archiveFile = "";
        String archiveFileTrimmed = "";
        int var2 = 0;
        File directory = new File(directoryName);
        File[] fList = directory.listFiles();
        Arrays.sort(fList, Collections.reverseOrder());
        // Traversing through all the files
        for (File file : fList){   
            // If the directory element is a file
            if (file.isFile()){       
                            trace.addInfo("Filename: " + file.getName()+ ":: Archive File Time: "+ Long.toString(file.lastModified()));
                            archiveFile = file.getName();
                          archiveFileTrimmed = archiveFile.substring(20);       
                          archiveFileSize = file.length();
                            if (archiveFileTrimmed.equals(newFile) && archiveFileSize == newFileSizeDouble ) {
                                    var2 = var2 + 1;
                                    trace.addInfo("Duplicate File Found."+newFile);
                                    if (var2 == 2) {
                                            break;
                            else {
                                    continue;
        if (var2 == 2) {
            var2 = 0;
            throw new StreamTransformationException("Duplicate File Found. Processing for the current file is stopped. File: "+newFile+", File Size: "+newFileSize);
    return Integer.toString(var2);
    Regards,
    Abhishek

  • Using File handling in JSP

    hi, I am working on website where i have to use file handling instead of database.i m using JSP,the job is,site's contact us page's information should store in a file (.txt) and as a administrator login then this file retrievs details of all the contact us forms information to a new page which directly open as administrator login.
    i am facing problem doing this please help how can i do this.its urgent.

    hi Shalini,
    Regadring upload please follow the link given below
    http://www.jguru.com/faq/view.jsp?EID=160
    Regarding reading the xl sheet, that you can do using this way
    try {
            BufferedReader in = new BufferedReader(new FileReader("xl sheet name.xsl"));
            String str;
            while ((str = in.readLine()) != null) {
                process(str);// what ever u want to with the line
            in.close();
        } catch (IOException e) {
        }See its alway easy to read data and print them in row/col
    format if it contains a delimiter(like * or , or |) after
    every column data. U can use StringTokenizer for separating
    out each column data.
    Just try this and see whether u r able to read or not.
    regards
    Goodieguy

  • Windows 7 unable to copy files in Aiport Disk

    I was just wondering if there's an existing fix to this problem. I am running a Macbook pro w/c can read and write to an airport extreme 's airport disk however my windows 7 w/c is on my lenovo(dual boot)is unable to copy files. Its XP partition can write to it perfectly. Could it be that 7 handles windows explorer differently or the protocols?please advise

    We don't do Windows here!
    I think a post in this forum would be better.
    DALE

  • File handling deprecated method - which one?

    I have this code, it should basically use the lines of text in a file and use them to construct nodes in a JTree. The compilation error is that the class uses a deprecated method - so does anybody know what method is the problem and what I should use?
    private void createNodes(DefaultMutableTreeNode top)
       DefaultMutableTreeNode anode = null; 
       File theFile = new File("categories.txt");
    try
    DataInputStream din1 = new DataInputStream(new FileInputStream(theFile));     
        //while (din1.available() !=0)
        while (true)
           String topic = din1.readLine().trim();
           //set the string as a tree node
           anode = new DefaultMutableTreeNode(topic);
           top.add(anode);
         din1.close();//close the file handle
         catch (Exception e)
              System.err.println("File input error");
    }//end of method

    If you compile with deprecation it will tell you specifically.
    I think it is:
    javac -deprecation ...
    The only method from below that I think it could be is readLine() in DataInputStream...
    If you are reading text...try:
    BufferedReader br = new BufferedReader(new FileReader(theFile));
    String topic;
    while ((topic=br.readLine())!=null)
        anode = new DefaultMutableTreeNode(topic);
        top.add(anode);
    br.close();

  • Report File Handle Release

    Hello All,
    I have a client that are using Crystal Reports embeded in their java web. They have stated that each time a report is run, a file handle is open and stays open for the rpt file.
    Has anyone has any experience with forcing java to release the rpt file handle?
    Thanks,
    Clark

    Thanks for the response.
    They are in a IBM Java RAD environment using Crystal v11 which is embedded with the suite.    I sent them the following snippet to release the file.    This should work right?
         //Release report.
         reportClientDoc.close();
    Clark

Maybe you are looking for