Can't read all attribute of my serialized object

Hello everybody,
I've got a problem with my program. I try to serialized a MutableTreeNode root in order to save and then open my JTree.
I serialize it and i have no problem but when i open it the parent hierarchy is saved (x is son of y...) but their name are null. I loose nodes' name... :/
               try {
                    //Je cr�e un fichier temporaire dans le r�p�rtoire courant
                    //Ce fichier est l'arbre (selection de l'utilisateur) serializ�
                    //Flux cr�ant un fichier
                    FileOutputStream fos = new FileOutputStream(this.path);
                    //Flux dans lequel je stocke un objet
                    ObjectOutputStream oos = new ObjectOutputStream(fos);
                    //J'�cris dans mon flux mon objet
                    System.out.println("root before drag = "+this.root); 
                    oos.writeObject(this.root);
                    //On ferme le flux
                    oos.flush();
                    fos.close();
               } catch (FileNotFoundException e1) {
                    System.err.println("FileNotFoundException");
                    e1.printStackTrace();
                    return null;
               } catch (IOException e1) {
                    System.err.println("IOException");
                    return null;
               } catch (ClassCastException e1) {
                    System.err.println("ClassCastException");
                    return null;
               try {
                    FileInputStream fos = new FileInputStream(this.path);
                    ObjectInputStream oos = new ObjectInputStream(fos);
                    //J'�cris dans mon flux mon objet
                    MutableTreeNode sousArbre = (MutableTreeNode) oos.readObject();
                    //On ferme le flux
                    fos.close();
                    //On r�cup�re l'arbre
                    System.out.println("root after drag = " + sousArbre);
                    this.root = sousArbre;
                    modele = new DefaultTreeModel(root);
                    Arbre.setModel(modele);
                    Aide a = new Aide(Arbre);
               } catch (FileNotFoundException e1) {
                    System.err.println("FileNotFoundException");
                    e1.printStackTrace();
               } catch (IOException e1) {
                    System.err.println("IOException");
                    e1.printStackTrace();
               } catch (ClassNotFoundException e1) {
                    System.err.println("ClassNotFoundException");
                    e1.printStackTrace();
               } catch (ClassCastException e1) {
                    System.err.println("ClassCastException");
                    e1.printStackTrace();
               }so:
System.out.println("root before drag = "+this.root);
return node name
Mais :
System.out.println("root after drag = " + sousArbre);
return null
Have you an idea ?
Thx :)

Please check your Node Object, I mean all Objects that you are going to save is serialized or not.

Similar Messages

  • I can't read all the characters on iTunes gift card

    I can't read all the characters on iTunes gift card

    If this page doesn't help then you will need to try contacting iTunes Support (you will probably need to give them images of the front and back of the card, and possibly its receipt) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • How can I read JPEG attributes?

    I am new to JAVA. I need some helps~~
    How can I read the JPEG attributes? The attributes here I say are Title, Subject, Author, Keywords, Comments. All of these can be found in the summary of jpeg files by clicking properties of the files in windows after a mouse right-click on them...
    If you have some suggestion, please tell me...Thank you.
    I have tried the getProperties() method in java.awt.Image, but it doesn't work.

    Thank you very much...I got some really useful stuff...
    www.exif.org/Exif2-1.PDF
    http://www.stuffware.co.uk/photostudio/v2-62/photostudio.exe

  • Afterf vs 6 upgrade. my outlook exchange site loads, but can't maneuver...when I click on something it locks up showing an error with java...can't read all as it locks

    after vs 6 upgrade. my outlook exchange site loads, but can't maneuver within page. when I click on something it won't move, but locks up and an error message comes up mentioning java problem...but can't read it all as the page is locked. needs to x out and reload.
    its the web page version of outlook exchange. there may also be a couple of other sites..after it loads, can't click on anything..no response....checked for latest version of java...and it verified I have latest.
    never happended before

    Whaoo,
       Looks like all I needed to do was ask the question and I would answer it. 
    It is definitely the outlook 2013 calendar item that had the new status.  Even though I changed the item to a valid status, I needed to completely remove the item and add it back in with a valid legacy status from the start. 
    -The Steve

  • How can i read all my past messages from imessage from my iphone into my laptop?

    i need to see my messages how can i read it on my lap top

    Install one of the many apps for your computer that can view iphone messages eithr from the iphone backup on your computer or directy from the phone.
    Google "iPhone mesage viewer"

  • Read a field of a serialized object

    Hi,
    is-it possible to read separately a field of a serialized object? By exemple, if I serialize an object that contains a String field, can I read only this String field?
    Thanks
    Jean

    You can do so, if you re-implement Java's serialization spec. That or overload readObject() and wait for your individual field to come in, trap the result and forward it on.
    As you can see from either of these alternatives, there is not a good way to do this. It's like asking 'how can I get an XML fragment from a file?" That task is, on the face of it, far easier. But it equally does not make sense.
    If you have control over the serialization, and you have a key lookup field, serialize it separately in an index-like file or serialize it ahead of Java's serialization in the same file.
    - Saish
    "My karma ran over your dogma." - Anon

  • How can I read the voltage from a serial port

    I am fairly new to LabView and I am having trouble figuring out how to read the DC voltage coming out of an RF Power Supply through a serial port so that I can monitor the voltage every few seconds. In order to do this do I need to purchase a DAQ card or anything like that?

    You would not need a DAQ card to read data over the serial port. You would, however, need a serial port. That may sound sarcastic, but it's not, since many manufacturers are ditching serial ports on computers. If you don't have a serial port then you would need to get something like a USB<->serial adapter or a serial port card that you plug into an expansion slot in your computer.
    Assuming you've got that then you need to find the command set for the RF Power Supply, and write drivers for it so you can send the command to read the voltage, and then read the resposen. I would suggest looking in the Instrument Driver Network to see if a driver for your supply has already been written. 

  • Can we read a file which is serialized in MFC using Java

    I have a file in which Serialized data is stored using an MFC application (object of CArchive).
    1. Is it possible to read this file using Java and to retrived the data.
    2. Is yes, which all Java-classes will be needed to explored.
    Thanks
    -Vini

    I have a file in which Serialized data is stored
    using an MFC application (object of CArchive).
    1. Is it possible to read this file using Java and to
    retrived the data.Yes.
    2. Is yes, which all Java-classes will be needed to
    explored. It depends on the data that is being retrieved. You need to read the data using whatever Java classes match. You might want to read the tutorial about this:
    http://java.sun.com/docs/books/tutorial/essential/io/datastreams.html
    >
    Thanks
    -Vini

  • How can i read all the lines from a text file in specific places and use the data ?

    string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt");
    for (int i = 0; i < lines.Length; i++)
    if (lines[i].StartsWith("ComboBox"))
    And this is how the text file content look like:
    ComboBox Name cmbxOption
    Classes Win32_1394Controller
    Classes Win32_1394ControllerDevice
    ComboBox Name cmbxStorage
    Classes Win32_LogicalFileSecuritySetting
    Classes Win32_TapeDrive
    What i need to do is some things:
    1. Each time the line start with ComboBox then to get only the ComboBox name from the line for example cmbxOption.
       Since i have already this ComboBoxes in my form1 designer i need to identify where the cmbxOption start and end and when the next ComboBox start cmbxStorage.
    2. To get all the lines of the current ComboBox for example this lines belong to cmbxOption:
    Classes Win32_1394Controller
    Classes Win32_1394ControllerDevice
    3. To create from each line a Key and Value for example from the line:
    Classes Win32_1394Controller
    Then the key will be Win32_1394Controller and the value will be only 1394Controller
    Then the second line key Win32_1394ControllerDevice and value only 1394ControllerDevice
    4. To add to the correct belonging ComboBox only the value 1394Controller.
    5. To make that when i select in the ComboBox for example in cmbxOption the item 1394Controller it will act like i selected Win32_1394Controller.
    For example in this event:
    private void cmbxOption_SelectedIndexChanged(object sender, EventArgs e)
    InsertInfo(cmbxOption.SelectedItem.ToString(), ref lstDisplayHardware, chkHardware.Checked);
    In need that the SelectedItem will be Win32_1394Controller but the user will see in the cmbxOption only 1394Controller without the Win32_
    This is the start of the method InsertInfo
    private void InsertInfo(string Key, ref ListView lst, bool DontInsertNull)
    That's why i need that the Key will be Win32_1394Controller but i want that the user will see in the ComboBox only 1394Controller without the Win32_

    Hello,
    Here is a running start on getting specific lines in the case lines starting with ComboBox. I took your data and placed it into a text file named TextFile1.txt in the bin\debug folder. Code below was done in
    a console app.
    using System;
    using System.IO;
    using System.Linq;
    namespace ConsoleApplication1
    internal class Program
    private static void Main(string[] args)
    var result =
    from T in File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TextFile1.txt"))
    .Select((line, index) => new { Line = line, Index = index })
    .Where((s) => s.Line.StartsWith("ComboBox"))
    select T
    ).ToList();
    if (result.Count > 0)
    foreach (var item in result)
    Console.WriteLine("Line: {0} Data: {1}", item.Index, item.Line);
    Console.ReadLine();
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

  • How can I read ALL the compilation errors in a DOS window?

    On compilation using a DOS window, if the number of errors exceeds the window size, some of the errors disappear off the top of the window and I cannot read them.
    Is there an effective solution to somehow use scrolling of the DOS window or transfer the compilation errors to a file?

    Hey buddy,
    When I first started programming with Java, I wondered the same thing. I have the very best solution for you. This one is waaay easy!!!!
    There is a text editor which will not only color code your text for you, but you can easily configure it to give you the compiler /DOS output for Java. Just go to this website and download the program. Enjoy!
    http://www.textpad.com/

  • TS1292 I can't read all of the code on my iTunes card. How do I redeem my money?

    My iTunes card is missing part of the code. How can I redeem my card?

    Click here and request assistance, supplying as much of the code as you can.
    (75058)

  • Can't load all properties of a remote object

    Hi,
    I have a java class called
    Employe which has a field of type
    Group(an java class)
    when i get the Employe Object in flex using remote Object and
    try to access Group's properties like
    employe.goup.name, i get:
    "Error #1009: Cannot access a property or method of a null
    object reference".
    Can some one please help me! Thank you.

    Please check your Node Object, I mean all Objects that you are going to save is serialized or not.

  • Can we define id attribute value of WorkItem Object in WorkFlows

    I got the below mentioned answer, How ever, Can you please help me to set id of workItem object in Manual Action defination?
    "Before you create your workItem generate a new id using the following function:
    <invoke name='getUniqueId' class='com.waveset.util.Util'/>
    Then in your manual action assign this id so that way you will know the workItem id in advance. "
    Actually my requirement is: I need to send the "URL of workItem Object form" in the email notification. So my thought is if I can get the id of workItem Object then easily prepares the URL.
    Please let me know, incase of any ideas on this.
    Thanks,
    Ravi.

    Can you please suggest how to provide workitem link to manager thru email?
    Thanks in Advance !!!
    Thanks,
    Ravi.

  • How can Java read VC++ serialized achieve file

    After finally realizing Java is much more powerful than C++, I am currently transferring my VC++ codes to Java and having a problem on how to read my old VC++ serialized achieve files. In java.io, can readObject() do the same job as VC++'s Serialize(ar)?
    In VC++ codes, my data was structured as the following:
    struct TickData {
         time_t     time;
         double     price;
         int     size;
    CList<TickData, TickData &> m_tickList[TICKER_MAX];
    m_tickList[nId].Serialize(ar); // VC++ data was saved this way
    Does anyone know what java method and how I should use to read all my old VC++ serialized files?
    Help on this will be greatly appreciated! Thanks.

    Unless you find some library somwhere, I strongly suggest to write a conversion tool in VC++.
    It takes a serialized file as input and spits out a file in a language independent format: XML,
    CSV, INI, Java properties, whatever. You Java program will use this format, not serialization,
    so you will never have this kind of problems in the future.

  • My ipad has frozen leaving candy crush, I tried to put it off using the on/off button, but now I have a black screen with no function. I can't read the serial number on the back as it is tiny.! any ideas?

    My Ipad mini has frozen leaving Candy crush. I tried to put it off using the on/off button, now the screen is black with no function. I can hear Siri if I push the control. It is charged. Any ideas? I can't read the very small printed serial number on the back so can't use the Apple help as they require the serial number.

    Hold down the sleep/wake button and the home button for ~10 seconds, or until the apple logo appears.  This is called a reset.
    HTH

Maybe you are looking for

  • WRT1900 AC V1 - Linksys is aware that the router is not working properly. Help spread the word.

    I just had a conversation with Linksys' Customer Service via chat: Daphne L. J: Hello Fernando Paramo. My name is Daphne L.. Daphne L. J: Welcome to Linksys Global Chat. Is this your initial contact or do you have a case number? You: Case number is 0

  • When did Adobe become such a sleazy company?

    I made the mistake of trying a free trial month of Adobe Pro XI.  Whenever I would try to open any kind of PDF document with my Adobe X reader, an ad kept coming up saying that my free trial had ended and would I like to buy a year's subscription for

  • Why are photos in my Photo Stream not in my Library?

    I have severak photos in my Photo Stream that are not showing in my Library.  Even after clicking show in Library the photo doesn't show.  Any thoughts?

  • Porting of SPARC application to x86

    Hi All - I have SPARC working application code, which needs to be ported to solaris 10 x86. I added -D__386 to the compile flags. Compiled fine, but have problems in running. If I compile with -D_BIG_ENDIAN, seems like the application processes go fu

  • Bar code print  problem

    Hi friends,     Please don't tell me that "before posting the thread search in google" because i searched this thing and then i'm posting the thread. the problem is given below. I'm using the barcode "BC_CD39" it displays in print preview but in prin