Can we not store Arraylist in a File? - NotSerializableException Error

Hello frnds,
wht am doing is storing Arralist object in a File.. Here is piece of code where am doing that..
public StoreData(ArrayList arrlst) {
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      File file = new File("DATA.txt");
      FileOutputStream fos = new FileOutputStream(file.getName(), false);
      ObjectOutputStream oos = (file.length() > 0) ?
          new NoHeaderOutputStream(fos) : new ObjectOutputStream(fos);
      oos.writeObject(arrlst);
      oos.flush();
      oos.close();
      fos.close();
    catch (NotSerializableException e) {
      System.out.println("Error in Serialization");
    catch (IOException e) {
      System.out.println("Error" + e);
    }But each time I run code.. it gives NotSerializableException .. so I caught it.. !!
Can any one tell me is there any way to store Arraylist?.. or what am doing wrong!!
Thanks in advance
gervini

Inside Arraylist is object of Profile Collection--> Inside that is SpriteFrameCollection--> SpriteFrame--> Sprite
I am new to java.. Have to take care of many sprites in a frame.. then many frames in Frame collection.. and finally many frame collection..
Am finally storing ProfileCollection Object in Arraylist.. is that wrong way??
Please help.. am really too much confused!!
public class ProfileCollection { // Consisting of many frames..
  ArrayList profilelist = new ArrayList(); // Arraylist of many frames
  String pname;
  void addFrameCollection(int index, SpriteFrameCollection framecoll) {
    profilelist.add(index, framecoll);
public class SpriteFrameCollection { // Consisting of many frames..
  ArrayList spriteframelist = new ArrayList(); // Arraylist of many frames
  String aname;
  int fps;
  void addSpriteFrame(int index, SpriteFrame spriteframe) {
    spriteframelist.add(index, spriteframe);
public class SpriteFrame { // Full One Frame consisting of many sprites..
  ArrayList spritelist = new ArrayList(); // arraylist containing many sprites
  ImageIcon icon = null; // arraylist containing whole frame as ImageIcon
  int frameno = -1;
  void addSprite(Sprite sprite) {
    spritelist.add(sprite);
}// And Finally.. Sprite Class
public class Sprite               // Each single sprite
     Image img;
     File file;                 // is filepath where this sprite is located
     int xcord,ycord;           // xcoord,ycoord are real position in frame
     int numberinfile;           // this is the position of the sprite in the raw file
        int mirrorh, mirrorv;      // for normal=00,horizontal=10,vertical=01,both=11
        int bitno;
        boolean transparent;
     void newSprite(Image img, File file, int xcord, int ycord, int numberinfile, int mirrorh, int mirrorv, int bitno, boolean transparent)
          this.img = img;
          this.file = file;
          this.xcord = xcord;
          this.ycord = ycord;
          this.numberinfile = numberinfile;
          this.mirrorh = mirrorh;
          this.mirrorv = mirrorv;
                this.bitno = bitno;
                this.transparent = transparent;
     public Sprite(){}
}gervini

Similar Messages

  • HT2674 I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive. Now, the trash can will not empty some of the files deleted.  File folder: "Core Services" contains a locked file: "boot.efi".  It will not

    I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive which operates from Time Machine.
    Now, the trash can will not empty some of the files deleted from the backup harddrive.
    The trash contains-- File folder: "Core Services" which contains a locked file: "boot.efi". 
    It will not delete.
    How do I get the trash can empty of these files?

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • Why can I not convert pdf into word file?

    why can I not convert pdf into word file?

    This is not a feature of Adobe Reader. You'll need either Acrobat or a subscription to one of the web-based services that Adobe offers (like PDF Pack) to do it.

  • Illustrator CS6 does not store the last opened files

    I need Help,
    Illustrator CS6 does not store the last opened files.

    THat indicates a permissions issue on your preferences file and/ or your files are stored on some external or network device that doesn't use persistent file paths. Look into that.
    Mylenium

  • I have an iMac(mid2010) running Pages v5.5.1 on OS X 10.10. Why can I not save or share documents. The error message is You can't save the file "TEST.pages" because the volume is read only.

    I have an iMac(mid2010) running Pages v5.5.1 on OS X 10.10. Why can I not save or share documents. The error message is You can’t save the file “TEST.pages” because the volume is read only.
    I get the same message when using Numbers so I presume it is a OS problem

    Some of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock those files and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Back up all data before proceeding.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button
    Select
               ▹ Restart
    from the menu bar.

  • Pls help.JSP: I could not store Chinese characters into files.

    Hi experts,
    I have this problem of cant store chinese characters into files(eg. .txt and .properties). I am adding
    these chinese text through a JSP website form....After i key in chinese characters in the textboxes
    in the website and sumbit the results, my chinese characters turned into ASCII or rather garbage in
    the files.
    Is there any way i can get the exact chinese characters i entered in the webite into the files?
    Need urgent assistance here.
    Thanks
    <%@ page contentType="text/html; charset=big5" %>
    <html>
    <head>
    <title>Confirmation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    </head>
    <%@ page language="java"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.lang.Integer.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.sql.ResultSet.*"%>
    <%@ page import="javax.servlet.*"%>
    <%@ page import="javax.servlet.http.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.URL"%>
    <%
    //getting attributes from previous page form
    //At this point, chinese characters r retrieved
    //Ascii/garbage displayed for text when retrieved from previous page.
    String gameName=request.getParameter("name");
    String encode=request.getParameter("encode");
    String gameType=request.getParameter("type");
    String info=request.getParameter("description");
    int check=0;
    int nextGameID;
    String temp="";
    String langCode="";
    //establish connection
    Connection con = null;
    try {
    Class.forName("org.postgresql.Driver");
    con = DriverManager.getConnection("jdbc:postgresql://172.20.134.110:5432/smsINTFET" , "postgres",
    "postgres");
    catch(ClassNotFoundException e) {
    out.println("Could not load the driver: "+e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught in relax db: "+ e.getMessage());
    Statement stmt = null;
    ResultSet rs = null;
    ResultSet ps = null;
    String strSQL = "";
    String strSQL2 = "";
    String tempCat = "";
    strSQL="SELECT gamename FROM cp_games order by gameid;";
    try {
    stmt = con.createStatement();
    rs = stmt.executeQuery(strSQL);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    while(rs.next())
    check=0;
    temp=rs.getString("gamename");
    if(temp.equalsIgnoreCase(gameName))
    // there is similar record in database
    check=1;
    break;
    else
    check=0;
    if(check==0)
    %>
    <body background="button/bkgd.jpg" bgproperties="fixed">
    <p><b><font size="30pts" face="Monotype Corsiva">Confirmation</font></b></p>
    <HR style="WIDTH: 500px; COLOR: blue; HEIGHT: 3px">
    The following information has been added.
    <table width="75%" border="0" cellspacing="0" cellpadding="2">
    <%
    String strCat="";
    strCat="INSERT INTO cp_games(gamename,description,encode) values('"+gameName+"','"+info+"','"+encode+"');";
    stmt = con.createStatement();
    stmt.executeUpdate(strCat);
    System.out.println("Successful inserted category");
    stmt.close();
    //setting language
    if(encode.equals("ascii"))
    langCode = "US";
    if(encode.equals("ms950"))
    langCode = "TW";
    if(encode.equals("ms936"))
    langCode = "CN";
    strSQL2="SELECT gameid FROM cp_games where gamename = '"+gameName+"';";
    try {
    stmt = con.createStatement();
    ps = stmt.executeQuery(strSQL2);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    ps.next();
    nextGameID=ps.getInt("gameid");
    out.println("<B>The game number : </B>" + nextGameID);
    %>
    <tr>
    <td><B>Game added: </B><%=gameName%>
    </td>
    </tr>
    </table>
    <%
    String newFile="G:\\home\\smsGamesINTV2\\colorGame\\propertiesFiles\\FET\\CP_Game"+nextGameID+"_"+encode+"_"+langCode+".properties";
    try
    {               //begin file
    PrintWriter outFile=null;
    //create a new file and write the initial settings to file
    outFile=new PrintWriter(new FileOutputStream(newFile,true));
    outFile.println("game_intro="+nextGameID+")"+gameName+" - "+info);
    outFile.println("");
    outFile.println("game_title="+gameName);
    outFile.println("");
    outFile.println("game_type="+gameType);
    outFile.println("");
    outFile.println("qns_no=0");
    outFile.println("");
    outFile.println("ana_no=0");
    outFile.close();
    }//end file
    catch(IOException e)
    out.println("File Create Error");
    else // no match found
    out.println("Game,"+temp+ " already added");
    %>
    </body>
    </html>

    try to add this code under this line:
    <%@ page contentType="text/html; charset=big5" %>
    <% response.setContentType("text/html; charset=big5"); %>
    I have faced the problem like yours and it works fine for me. Try and see.

  • HT3204 new ipod touch. can access iTunes store. cannot create iTunes ID. get error "could not complete iTunes request. unknown error occured (-1202)".Ipod updated to latest issue,firewall exception allowed.SSL 3.0 & TSL 1.0 ok. Running windows Vista. Help

    New ipod touch 32gb. Can access iTune store.Can sample music selection. Completed latest update for ipod Can't make any purchases. Get error "could not complete your iTunes store request. An unknown error occured  (-1202)". security SSL 3.0 & TSL 1.0 OK. Firewall enabled for iTunes. ???

    laneymenion wrote:
    Using Proxy: Yes
    HTTP Proxy: 192.168.100.15:80
    Change the Using Proxy to No
    Have you allowed itunes and itunes helper in your security software firewall?

  • I can not log in due to file vault error

    I am the system administrator and I can not log in due to file vault problem.. How do I fix this?

    From a simple Google search of "repair file vault on Mac" I got this: Repairing a FileVault-protected Home folder
    OT

  • I can't not sign in becauce of a server error

    i can't not sign in becauce of a server error

    Hi there devbark,
    You may find the troubleshooting steps in the article below helpful.
    iCloud: iCloud Control Panel setup cannot be started
    http://support.apple.com/kb/TS5178
    -Griff W. 

  • "The installer could not copy the necessary support files." Error message on 0S X 10.6.3 Install

    I have just wiped my iMac 21.5' Core i3 3.2GHz as I am going to sell it. This process went as expected but when I try to reinstall the OS from the disk that originally came with the system (10.6.3) it gets around 30% into the install and then produces the error message "The installer could not copy the necessary support files." No matter what I try the outcome is the same and the installation fails.
    I did have the hard drive replaced on this iMac a couple of years ago as it was of a batch that apple said could go pop one day. Do the hard drive and the OS X disk that comes with the system have to match, or is it just a case of a faulty disc? Any help would be greatly appreciated.

    Hi sonicdeathmonkey1882,
    If you are having issues reinstalling the OS on your iMac, you may find the following articles helpful:
    Apple Support: Troubleshooting Mac OS X installation from CD or DVD
    http://support.apple.com/kb/HT2956
    Apple Support: Troubleshooting Mac OS X installation and software updates (Mac OS X v10.6 and earlier)
    http://support.apple.com/kb/ts1394
    Regards,
    - Brenden

  • Why can I not see and read individual files in icloud?

    According to the Genius at my local Apple store I have something in the software or files I backed up that us causing a problem with my iphone5, and the solution is to do a 'restore as new phone' after having saved all my data somewhere else (e.g. store all my photos and videos to flickr, email my voice corder files to myself by email) - in other words a major hassle.
    I don't understand why myself or an Apple technician can't just go into my icloud account, do a surgical strike to identify and destroy wherever the problem is and go from there.
    To restore piecemeal is cumbersome and time-consuming. And then I still won't know what caused the problem in order to avoid the problem reoccurring (such as avoiding certain third-party apps or whatever is the problem).
    Makes me think that maybe Dropbox or Google drive might be better choices from some purposes. I got icloud as a cyber filing cabinet, not just a backup if phone or to share across devices.

    You can see the individual data in your iCloud account.  You can see any of it within the apps on your phone that are syncing with iCloud (contacts, calendars, notes, reminders, etc.).  But how would you ever be able to tell which one is corrupt just by looking?  And that doesn't account for the thousands of files that make up the iOS, of other non-iCloud files on your phone.

  • Why can I not print out a pdf-file (train ticket NS) when downloaded with Firefox? (file says (SECURED)

    When ordering and paying a train ticket by internet they send a pdf-file, which one must download and print. When downloading this with Firefox (from my e-mail account) the pdf-file says (SECURED) and I cannot print out the ticket (pdf-file). (Adobe program stops automatically).
    When downloading this same pdf-file in Safari, I encounter no problems.

    Current Firefox versions have enabled a built-in PDF Viewer that doesn't have all features that other PDF readers like the Adobe Reader have or may not function properly otherwise.
    You can change the action for Portable Document Format (PDF) from Preview in Firefox to use the Adobe Reader application or set to "Always Ask" in "Firefox > Preferences > Applications".
    *https://support.mozilla.org/kb/change-firefox-behavior-when-open-file
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them

  • Why can I not open an unzipped keynote file folder on my iPad or MAC?

    Why does my keynote file get converted into a folder and get zipped when I try and e-mail it?  It didn't used to be like this?  It used to be just a .key file.
    Then as a result this creates a problem in trying to transfer the keynote file to another iPad.  The other iPad cannot pull the newly converted folder into Itunes because Itunes only allows you to upload a single file and not a folder.  Plus, I can't open the file on a Mac either.  It says keynote file not supported.
    Any suggestions?

    There was an option in the Old Keynote "Save new documents as packages". If it's off, the document would be automatically zipped. As a result, you couldn't "Show Package" on it.
    if you selected it, it would save as a package and you could "Show Package"
    This second one is what the new Keynote is doing and there's no option otherwise. SO, I believe you'll have to .zip the file yourself before emailing in order for it to send successfully. However, I'll have to play around a bit more specifically with the iPad interactions.
    OH, just thought about another option. Have you tried sharing via iCloud instead? It provides a link that can be pasted in an email and loaded from both Mac's and iPads (and PC's if they have a recent browser, it'll load in iWork for iCloud).
    Message was edited by: Kyn Drake

  • Why can I not copy text from a file and paste into "File Name" when saving?

    I thought I used to do this but I cannot copy a string of text from within AI (CS5, CS6 or CC) then "save as" and paste into the "file name" field. Why would this be?
    This proceedure works fine in Photoshop.
    Mac OSX 10.7.5.

    I am copying the characters not the object. Something seems to have changed at the system level. I can paste the text to other applications (Skype, Word, etc.) but not the "Save" dialog. I have been pasting the text to a Skype message window and re-copying. Then it will paste into the save dialog. Weird.
    I see you are on 10.6.8. Maybe it's a system difference.

  • Why can I not make comments on pdf files?

    OK this has been driving me nuts for a couple years now.  I used to have an earlier versison of Acrobat Reader (5.0 maybe?) where I could freely highlight and make comments throughout the document--very easy and straightforward.  When I got a new computer I had to go version 9--and now I cannot highlight, undlerline, comment or do ANYTHING at all with the text--on the very SAME documents I used to do this on (and on new ones as well).  Commenting is never allowed on ANY .pdf file I have.  WHY has Adobe done this????   Do I have to upgrade to some commercial version or what?  Frustrated as hell with this huge step backwards that completely limits my ability to find information in documents quickly.

    You probably didn't have Reader before, but Acrobat, which is the non-free
    version that allows you to create PDF files and to make comments. With
    Reader, you can only create comments if this was specifically allowed by the
    creator of the PDF. If you want this functionality you will other need to
    ask the creator of your files to enable commenting in Reader, or buy
    Acrobat.

Maybe you are looking for

  • Scanning "no connection" issue

    I am using a MAC 10.9 and a HP6500 E710n-z printer I am able to fax and print so I believe I have a good connection to my computer and I do see my computer name and I can select my computer as the destination for the scan. but then I get the error: T

  • Itunes has swapped to another language

    Hi there, I recently turned my computer off and back on, but my Itunes for some reason changed languages. All my header bars are now in French. Everything else inside Itunes is in english and my region also states English, it is just the top header b

  • Subscribing new users to my podcast in iTunes

    We're having an event. I'd love to get the people coming to subscribe to my podcast in iTunes, however, if they don't have their computer... how can they subscribe from my computer? Can't right? Is there a work around for this? G5 dual 2.5.g   Mac OS

  • Premiere 11 crashes when importing large video files

    I am running Premiere Elements 11 on Windows 8. When I attempt to use "Add Media" to import a 1 hour and 15 minute .wmv from my harddrive, Premiere freezes up and is forced to quit. There is no error message or anything, it simply locks up and become

  • How to disable a group of services

    I want to disable a group of services. For example online 15:56:55 svc:/network/ipsec/ipsecalgs:default online 15:56:58 svc:/network/ipsec/policy:default online 15:57:22 svc:/network/shares/group:default online 15:57:42 svc:/network/routing-setup:def