Vaibhav : error with file handling

I am using jdk 1.3 on winME.
I have written the following code for reading from a file.
import java.io.*;
class a
     public static void main(String args[])
          FileInputStream i ;
          try
               i = new FileInputStream(args[0]);
          catch(FileNotFoundException e){}
          catch(ArrayIndexOutOfBoundsException e){}
          int ch;
          try
               while((ch = i.read()) != 1)
                    System.out.println((char)ch);
               i.close();     
          catch(IOException e){}
On compiling I get the following error.
C:\soft3\Javatry> javac trial.java
trial.java:16: variable i might not have been initialized
while((ch = i.read()) != 1)
^
1 error
Please help me understand the error.
Thank you in advance.
Cheers.
Vaibhav.

the statement
FileInputStream i;
does not initialize the variable. In java everything must be initialized. When you do initialize it, you do it in a try catch block, which may or may not ensure initialization. To solve this, simply define your variable....
FileInputStream i = null;
Here you are forcing initializing of the object to the null value. (Null is not the same as unitialized).

Similar Messages

  • Sign on problems within Elements 10; plus cannot backup writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

  • NFS: server reboot - client problem with "file handle" - no unmont

    Hello,
    when I restart a NFS-server and a client has a NFS-share on it still mounted, that NFS-share becomes unusable on the client: everything causes the client complain about an old "file handle", even trying to unmount that share!
    So my question is: How to deal gracefully with a NFS-server reboot and avoiding this file handle problem?
    Apart from going to each client and unmount the NFS-share by hand?
    Thanks!

    Do I need to Give these values manually again as they are moved from Env to other?
    When we transport ID objects, the values stored in the channel get lost and have to be manually enetered......it happens even for DEV --> QA environment.
    Now your channel should reflect PROD-related data.
    2- Why my Receiver communiation channel coimg as
    Communication Channel | PRD_400 | RFC_QA3_Receiver:
    The channel name does not depend on the environment it is present....verify the name once again!
    Regards,
    Abhishek.

  • Problem with file handles : jdeveloper makes them getting smaller

    hello,
    I downloaded today jdeveloper 11.1.2.1 for linux and I installed it on my centos 6.2 (like redhat).
    I didn't read the prerequisites.
    the installation worked fine, but when I tried to modify the JDialog swing file of a view project, I have an error message telling me there are save file errors, and complaining the files handles are too small.
    I think the two errors are linked.
    I read some stuff on the net and found a tutorial explaining how to have fs.file-max=70000 in sysctl.conf and 30000 when you type ulimit -n, what is also explained in the prerequisites.
    so I ran jdeveloper a new time and found the same error.
    I opened a terminal, and saw that ulimit -n gives ... 1024.
    seems that the parameter is changed when I launch jdeveloper.
    can you see an explanation?
    thanks
    olivier

    the resolution is here : [http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.install.doc/topics/tincreasehandles.html|http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.install.doc/topics/tincreasehandles.html] .
    cool!

  • Problem with File Handler and log files

    I'm developing a polymorphic structure for file handling specially for the log file for a server based App... Its working fine except for one thing. The log file that goes into the File Handler comes as a parameter to the class, the problem is that when it writes de file, though it DOES know where it should go, it doesn't do it and it writes the message into some other Log file belonging to another process...
    Does someone know how to avoid this or fix it?? any ideas or tips would be great!!

    Immediately below the Tabs saying "Files" and Assets" is a small box 
    with arrow on the right to show the drop down list.        In the box 
    on the right there's an icon of two networked computers.  Then it 
    says, "ftp://Hill farm Web Site"  which is the name of my website.     
    If I click on the arrows to pull up the drop-down box,  I get four 
    options divided by a line.   Above the line the options are Computer, 
    HD and ftp://Hill farm Web Site.  Below the line it says manage sites.
    Below this is list of files that make up my website in a directory 
    structure.   The header for the first column reads, "Local Files",  
    which appears to be untrue, because the top line in the directory 
    structure below reads,  "ftp://Hill farm Web Site".
    Does this help?
    regards
    David

  • M new to this forum + new to java please help me with file handling program

    hi i want to make a file handling program where in i want to input a text file say f1 whose style is mentioned as below
    aaa...bcd
    aaabbc
    acdce
    a..dd
    abbcd
    now i want to write d out put of file f1 to file f2 but only those string entries widout any ... in them how to do that :-(( please help :((

    import java.io.*;
    import java.lang.*;
    class javcsse{
             void javsce (){
              BufferedReader in;
            PrintWriter out;
            String line;
            try
                in = new BufferedReader(new FileReader("e:\\cntcs\\n7.txt"));
                out = new PrintWriter("e:\\cntcs\\n8.txt");
               line = in.readLine();
               while(line != null)
                     if(line.contains("...") && line.contains("....")){
                         break ;                
                         else{
                               if(line.contains("cc"))
                              System.out.println(line+"\n");
                                      out.println(line);
                    line = in.readLine();
                in.close();
                out.close();
            } catch (Exception ex)
                System.err.println(ex.getMessage());
      public class javcse{
        public static void main(String[] args) {
            new javcsse();
    }hey i wrote this code yet could u tell y is it still not working :((

  • Can't use Boot Camp due to error with files

    I am trying to partition the hard drive on my mac and install windows so that i can run windows based programs and other reasons, but my mac is not new and it is harder than brain surgery to locate all the files i need to back up and the ones i dont. when i open boot camp, it starts partitioning the hard drive for a few minutes and i get the error message:            The disk cannot be partitioned because some files cannot be moved. Back up the disk and use disk utility to format it as single Mac OS Extended (Journaled) volume.  Restore your information to the disk and try using Boot Camp Assistant again. i cant format the disk because the computer only has one disk. and i cant format it. Please help!

    A very good way to handle this is to buy CarbonCopyClone ($40 download) and an external drive.  Then clone your startup disk to the external, and clone it back.
    What has happened is that after several years you have created so many tiny unused disk spaces (some only 1 or 2 blocks large) that OSX cannot relocate everything and make room.  When you "clone back", all files will be in a large section at the bottom of the available disk space and there will be plenty of room for BootCamp.

  • Error with "File System" destination only in a Publication

    Hello,
    I am able to have individual reports run & refresh to a File System destination, but when I attempt to have the same reports, as part of a Publication, save to a File System destination, I receive this error in the log:
    ERROR PublishingService:HandlerPool-32 BusinessObjects_PublicationAdminLog_Instance_15516 - Publication ID # 15516 - Distribution to destination CrystalEnterprise.DiskUnmanaged ... destination DLL disabled. [http://CrystalEnterprise.DiskUnmanaged ([1]/1])]: [ (FBE60013)
    If I use Email instead of File System in this Publication, the Publication runs fine, no issues.
    Thanks for any help.

    Let's start with proper terminology
    You're not sending report to unmanaged disk, you're scheduling it there.
    When you use publication - you're publising it there.
    2 different worflows, that use 2 different servers. Each server has to be configured for this functionality.
    It is done in CMC in servers properties.
    Admin guide will give you information on what each server in BO architecture is responcible for and what are the parameters that needs to be set for various workflows.

  • Error with file creation

    Hi,
    On a server we have set up two groups; administrators and users. Administrators have access to all files and locations and can make changes in all files. Users have their access restricted to use software etc, they cannot modify any file.
    We are using Sage as an accounting package and wish to extract reports from this. As an administrator there are no issues, the file is created and can be saved to their desktp. If a user attempts to do this then
    However, when a user attempts to do this an error is produced, the report is lost and the system crashes.
    I believe this is something to do with these permissions mentioned at the top. Therefore, does anyone know what permission are required to save/create a .PDF file?
    Thanks,
    Ross

    Hi all,
    Just to clarify, i am not stating that there is an issue with adobe as administrators are able to create a file. The problem i have is with the permissions on the Adobe files. The reason it is the permissions is that an .XLS file can be created but as soon as the user selects .PDF the system crashes.
    Does anyone know the required permissions to create an adobe file, to be read in Adobe reader?
    Thanks,
    Ross

  • OVM Manager 2.2.2: server pool error with file system type

    I'm just getting started with OVM. I've installed OVM on one machine and the manager on another.
    I created a server pool, which seemed to work OK but shows "Error" in the table under the "Server Pools" tab in the manager interface
    When I edit it I see
    Error: OVM-1011 OVM Manager communication with NNN.NNN.NN.NNN for operation Pre-check cluster root for Server Pool failed: <Exception: SR '/dev/sda3' not supported: type 'ocfs2.local' not in ['nfs', 'ocfs2.cluster']>
    Can anyone explain this? Does this mean I can't use a local file system in OVM 2.2.2? I understood this was the case with OVM 3, which is why I went with 2.2.2.
    Thanks.

    Roger Ford wrote:
    Error: OVM-1011 OVM Manager communication with NNN.NNN.NN.NNN for operation Pre-check cluster root for Server Pool failed: <Exception: SR '/dev/sda3' not supported: type 'ocfs2.local' not in ['nfs', 'ocfs2.cluster']>
    Can anyone explain this? Does this mean I can't use a local file system in OVM 2.2.2? I understood this was the case with OVM 3, which is why I went with 2.2.2.You can't created a clustered pool with a local filesystem. You need to format the filesystem with ocfs2 in clustered mode.

  • Coldfusion MX7 error with file upload

    Hi all,         I am using coldfusion mx7 server. While upload an excel file with(97-2003) format, I am getting the following error:  Unable to construct record instance, the following exception occured: null
    I am getting this error when I enters some data and save in my  desktop with the format(97-2003) and after using a cfx tag to dump the  uploaded data, I am getting this error. But if I just upload the  template only without entering any data it will shows/dump the column  names in template..
    Is there any way to upload the same excel file with MX7?
    Thanks in advance

    To answer your final question: yes of course it's possible to upload any file type with any version of CF.  One has no dependency on the other.
    As for the rest of it: without seeing some code, it's impossible to really:
    a) understand what you're asking;
    b) work out what might be causing the problem.
    Adam

  • Error with file adapter

    HI ALL,
           Our Secnario is Bapi to File.Hear in the Target side we have two target folders.For that I am internally place my file in the PI and pick up the file from PI and posted to end directories.For that Hear i am using 2 flows form BAPI to FILE.But problem is when i am monitoring the Receiver comm channel at target PI system its shows some error like    Unable to clone File Adapter receiver channel for parallel processing and files are not posted in the target system
    please provide the better solution for this issue
    Thanks & Regards,
    Satya

    Hi,
    I am internally place my file in the PI and pick up the file from PI and posted to end directories
        Elaborate that process.
    How to split the target directories. In this scenario is BPM? or Any rule implemented in Receiver determination.
    Regards
    Vijaykumar

  • Error with file joining to a table

    I am creating an interface that has a file joining a table as the source. After joining, I got the error below:
    "No staging area selected. You must have a target datastore or set a staging area in the 'Definition' tab."
    What must I do to fix this error?
    Thanks.

    Exactly as it says, you must define the target datastore, before you will be able to successfully define the joins for hertogeneous technologies. (I tend to drag the target on to the interface first, then the sources)
    Craig

  • Baseline FR V5.600 Error with file SMBA0_CSKU_O13F_J0C_103_01

    Hi Experts,
    We are installing SAP Baseline V5.600 and we get an error during the file upload in /smb/bbi
    The following file seems to not be correct SMBA0_CSKU_O13F_J0C_103_01 but we don't understand the message.
    All the lines of this file are in error; here are the 2 log messages we get for each line of the file :
    Object ID /SMBA0/CSKU_O13F_J0C
    Filename  SMBA0_CSKU_O13F_J0C_103_01.TXT
    Variant ID  *Var321
    Parameter Name  I_LTEXT_1
    Error TDC: GRA is not defined in corresponding ECATT/BCSET Object
    Object ID /SMBA0/CSKU_O13F_J0C
    Filename  SMBA0_CSKU_O13F_J0C_103_01.TXT
    Variant ID  *Var321
    Parameter Name  I_LTEXT_1
    Error TDC: POU is not defined in corresponding ECATT/BCSET Object
    We don't find any note about this error and we are blocked since the file upload is stopped because of these errors.
    Please could you help us to determine what these messages mean?
    Best regards,
    Florence

    Hi experts,
    I am trying to translate enterprise structure (plants, warehouses, purchasing org...) by loggin in the destination language (for example english) and change the description but the translation applies to all languages (the changes occur also when I log in french or german).
    When I translate other objects like material type or material group it is ok because the description fields are empty in the destination language connexion, why not for the structures? How can I translate these structures in several languages?
    Thanks for your answer.
    Florence

  • Help with file handling

    hi guys, i have an assignment. basically my problem is writing data to an external file over and over again, without overwriting the previous data. the problem with this code is that after one iteration of the while loop, it overwrites the previous data. how can i make the program write to another line in the file without over-writing the previous data? thanks.
            while (true)
            int questno = inputquestNo();
            int postcode = inputpostCode();
            int age = inputAge();
            if (age <=25) count25less++;
            if (age >=26 && age <=45) count26to45++;
            if (age >=46) count46more++;
            String gender = inputGender();
            if (gender.equalsIgnoreCase("M")) countmale++;
            if (gender.equalsIgnoreCase("F")) countfemale++;
            for (int i=0;i<noq;i++)
                System.out.print("Response to Question " + (i+1) + ": ");
                int ans = in.nextInt();
                    while(!(ans>=1 && ans<=question.length))
    System.out.print("Invalid input, try again: " );
    ans = in.nextInt();
    question[i][ans-1]++;
    try
    fout = new FileOutputStream("store.dat");
    out = new PrintStream(fout);
    out.println(questno + " " + postcode + " " + age + " " + gender);
    fout.close();
    catch (IOException e)
    System.err.println("Unable to write to file");
    System.exit(-1);
    System.out.print("Exit?");
    String exit = in.next();
    if (exit.equalsIgnoreCase("Y")) break;
    if (exit.equalsIgnoreCase("N")) System.out.println("");

    hey thanks, it works. i just had to change the following to the above code
    fout = new FileOutputStream("store.dat", true);FileOutputStream(File file, boolean append)

Maybe you are looking for

  • Let us solve this Verizon Service Quality debate for good

       Motorola Droid here.      I don't frequent this forum too often, I probably glance at it once a week or so, but it doesn't take a regular visitor to take notice that this forum is always peppered with 3G complaints, some more or less valid than ot

  • How do I change an IMAP MacMail acct. to a POP acct on my iMac?

    Hello, I have an iMac OS 10.6.8 and am using MacMail through AT&T (I know, yuck). Today I created a new macmail account. I noticed it automatically created an IMAP account. I also noticed the incoming and outgoing mail servers didn't match my other e

  • What on earth do I do with this?

    Hi everyone- So, my computer keeps shutting down spontaneously on me. All of a sudden, my screen will fade to gray and I'll get a "you need to restart your computer" message with a big power button icon in the background. Here's what I get when I res

  • Volume size limit on JBOD RAID (apple software built-in) with USB2

    I use a MacMini as our home server. It hosts TimeMachine as well as the swelling iTunes stuff. The server has a concatenated RAID HFS+ from 4x500GB SATA2 drives over USB2. The size was 1.7TB. I'm running out of space for Time Machine on this JBOD RAI

  • Union is slowing down the result

    hi there I am using this query to get some result select initials||' '||surname NAME, person_id Value from persons where person_id in ( select distinct rtm_last_updated_by from ret_main) union select '%' NAME, '%' Value from dual this query is taking