Java.io.NotSerializableException when overwrite the JTable data into .txt

hi everyone
i had java.io.NotSerializableException: java.lang.reflect.Constructor error when overwrite the JTable data into .txt file.
At the beginning, the code will be generate successfully and the jtable
will be showing out with the data that been save in the studio1.txt
previously,
but after i edit the data at the JTable, and when i trying to click the
save button, the error had been showing out and i cannot succeed to
save the JTable with the latest data.
After this error, the code can't be run again and i had to copy the studio1.txt again to let the code run 1 more time.
I hope i can get any solution at here and this will be very useful for me.
but i dunno how to attach my .txt file with this forum
did anyone need the .txt file?
the following is my suspect code
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String filename1 = "studio1.txt";
          try {
              FileOutputStream fos = new FileOutputStream(new File(filename1));
              ObjectOutputStream oos = new ObjectOutputStream(fos);
               oos.writeObject(jTable2.getModel());
               oos.flush();
               oos.close();
               fos.close();
          catch(IOException e) {
               System.out.println("Problem creating table file: " + e);
                        e.printStackTrace();
               return;
          System.out.println("JTable correctly saved to file " + filename1);
}this is the reading code
String filename1="studio1.txt";
        try {
               ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
               TableModel model = (TableModel)ois.readObject();
                jTable3.setModel(model);
               System.out.println("reading for " + filename1);
          catch(Exception e) {
               System.out.println("Problem reading back table from file: " + filename1);
               return;
          }Edited by: Taufulou on Jan 8, 2009 11:43 PM
Edited by: Taufulou on Jan 8, 2009 11:44 PM
Edited by: Taufulou on Jan 8, 2009 11:45 PM

is this the code u mean?
i had put this code inside it but the problem still remain the same
if (jTable2.isEditing()) {
            jTable2.getCellEditor().stopCellEditing();
        }i had found a new thing that when i just double click the cell without change any data inside the table
and click the button "Save". the same exception which is
java.io.NotSerializableException: java.lang.reflect.Constructor
will come out again.

Similar Messages

  • Java.io.NotSerializableException when overwrite the JTable data into .txt file

    hi everyone
    this is my first time to get help from sun forums
    i had java.io.NotSerializableException: java.lang.reflect.Constructor error when overwrite the JTable data into .txt file.
    At the beginning, the code will be generate successfully and the jtable will be showing out with the data that been save in the studio1.txt previously,
    but after i edit the data at the JTable, and when i trying to click the save button, the error had been showing out and i cannot succeed to save the JTable with the latest data.
    After this error, the code can't be run again and i had to copy the studio1.txt again to let the code run 1 more time.
    I hope i can get any solution at here and this will be very useful for me.
    the following is my code...some of it i create it with the GUI netbean
    but i dunno how to attach my .txt file with this forum
    did anyone need the .txt file?
    this is the code that suspect maybe some error here
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    String filename = "studio1.txt";
              try {
                  FileOutputStream fos = new FileOutputStream(new File(filename));
                  ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(jTable2);
                   oos.close();
              catch(IOException e) {
                   System.out.println("Problem creating table file: " + e);
                   return;
              System.out.println("JTable correctly saved to file " + filename);
    }the full code will be at the next msg

    this is the part 1 of the code
    this is the full code...i had /*....*/ some of it to make it easier for reading
    package gui;
    import javax.swing.*;
    import java.io.*;
    public class timetables extends javax.swing.JFrame {
        public timetables() {
            initComponents();
        @SuppressWarnings("unchecked")
        private void initComponents() {
            jDialog1 = new javax.swing.JDialog();
            buttonGroup1 = new javax.swing.ButtonGroup();
            buttonGroup2 = new javax.swing.ButtonGroup();
            buttonGroup3 = new javax.swing.ButtonGroup();
            buttonGroup4 = new javax.swing.ButtonGroup();
            jTextField1 = new javax.swing.JTextField();
            jLayeredPane1 = new javax.swing.JLayeredPane();
            jLabel6 = new javax.swing.JLabel();
            jTabbedPane1 = new javax.swing.JTabbedPane();
            jScrollPane3 = new javax.swing.JScrollPane();
            jTable2 = new javax.swing.JTable();
            jScrollPane4 = new javax.swing.JScrollPane();
            jTable3 = new javax.swing.JTable();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
    /*       org.jdesktop.layout.GroupLayout jDialog1Layout = new org.jdesktop.layout.GroupLayout(jDialog1.getContentPane());
            jDialog1.getContentPane().setLayout(jDialog1Layout);
            jDialog1Layout.setHorizontalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 400, Short.MAX_VALUE)
            jDialog1Layout.setVerticalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 300, Short.MAX_VALUE)
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jLayeredPane1.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);
            String filename1 = "studio1.txt";
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable2 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable3 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            jTable2.setRowHeight(20);
            jTable3.setRowHeight(20);
            jScrollPane3.setViewportView(jTable2);
            jScrollPane4.setViewportView(jTable3);
            jTable2.getColumnModel().getColumn(4).setResizable(false);
            jTable3.getColumnModel().getColumn(4).setResizable(false);
            jTabbedPane1.addTab("STUDIO 1", jScrollPane3);
            jTabbedPane1.addTab("STUDIO 2", jScrollPane4);
            jTextField1.setText("again n again");
            jLabel6.setText("jLabel5");
            jLabel6.setBounds(0, 0, -1, -1);
            jButton2.setText("jButton2");
            jButton1.setText("jButton1");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
          

  • Error when activating the master data

    Hi
    I am getting the following error when activating the master data. when using IDOC as transfer method in transfer rules
    <b>Error while creating table 'EDISEGMENT' entry '/BIC/CIRB0CLASS_NUM_TEXT'</b>
    If anyone came across this kind of problem plz share the solution.
    Regards
    Annie

    Hi
    I solved the problem. AFter changing from PSA to IDOC, i just saved first and activated. it got activated. But thanks for the response.
    There are no short dumps in ST22
    Regards
    Annie

  • Just bought a used MacBook pro after my previous died. I want to migrate my applications, data, etc from a time machine backup of the old computer to the new. Will this affect, or overwrite the Apps., data, etc existing on the new machine?

    Just bought a used MacBook pro after my previous died. I want to migrate my applications, data, etc from a time machine backup of the old computer to the new. Will this affect, or overwrite the Apps., data, etc existing on the new machine?

    No. Only those Apps that are not installed on the new will migrate over.

  • Error when reading the access data for the Adapter Engine

    We are getting the following error in XI. It started on Jan 22 and resolved on Jan 23 automatically. Nothing has been changed and we don't able to understand how problem started and how it resolved:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
      <SAP:P1>af.xpd.dbcixpd</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>3: Unable to find URL for Adapter Engine af.xpd.dbcixpd</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when reading the access data (URL, user, password) for the Adapter Engine af.xpd.dbcixpd</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    Pls suggest if anyone has gone thru same problem.
    Regards
    Amar

    I got the same problem while using RFC lookup.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
      <SAP:P1>af.tx1.netweaver</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>3: Unable to find URL for Adapter Engine af.tx1.netweaver</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when reading the access data (URL, user, password) for the Adapter Engine af.tx1.netweaver</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Any idea ,when we get this error usually.

  • Error when reading the DDIC-data for table

    Hi Tobias
    We upgraded from DMIS 2011 SP04 to SP07. We are in development system.
    To test initial load, we stopped replication for an existing table and then started replication for the same table.
    Mass transfer id connects ECC system to BW on HANA system.
    Replication errored with the following message:
    Error when reading the ddic-data for table MARD (RFC destination DWACLNT010).
    Looking for your guidance.
    Kind Regards
    Kamaljit Vilkhoo

    Was able to solve using oss note 1972533.

  • Error when tranfering the text data

    Hi all
    I am getting an error when transfering the text data thru flat files .
    It is asking " No transfer structure available for the source system ," and saying that 0langu is not assigned to source syatem.I am working on 3.5.
    pls suggest me.
    thanks in advance
    karna

    here are teh steps:
    1) craete source system in BW as say Flat_file
    2) go to inforsource --?  create inforsource --> right clik on infosource and say assign datasource
    3) select flat_file here and say YES
    4) then for flat file, trnafer structure mapping has to be done manually. so in trs struc screen ,go to datasource tab and enter your corresponding infoobject.
    5) then  go to tranfer rule tab and propose the rule.
    If it helps, please assign points. In case of doubt, please get back
    Regards
    Pankaj

  • Error when extracting the text data

    Hi all
    I am getting an error when transfering the text data thru flat files .
    It is asking " No transfer structure available for the source system ," and saying that 0langu is not assigned to source syatem.I am working on 3.5.
    pls suggest me.
    thanks in advance
    karna

    hi,
         you have to decline 0LANGU, STTXT(short text), MDTXT(medium text),
    LGTXT(long text), and respective key field(primary key) of attribute for
    text data source.  give the above five info object's in transfer structure for
    text data source and activate it.
    if helpful provide points
    regards
    harikrishna.N

  • Error when reading the access data(URL,user, password) for Adapter Engine

    Hi,
    We are getting this error in production system 
    "SXMBSysErrorAlerts, Category INTERNAL, Error code: AE_DETAILS_GET_ERROR error text: Error when reading the access data (URL, user, password) for the Adapter Engine".
    Please tell what can be the cause of error. Where are the access data (URL, user, password) for the Adapter Engine read from?
    Its urgent.  We are in support project.
    regards,
    john

    Hi jhon,
              please check the following threads to resolve the problem.
    AE_DETAILS_GET_ERROR
    Error : no_adapter_engine_found: Unable to find Adapter Engine
    regards
    mahesh.

  • Error 4 when updating the text data

    When i am trying to load the data  using IP i am facing the issue Error 4 when updating the text data.Please suggest me
    Edited by: srikanth reddy612 on Dec 15, 2011 12:45 PM

    hi srikanth,
    you might have selected given lowercase data
    and please check in the Infoobject the lowercase Checkbox is unchecked then it will allow you to update from IP.
    also check in the Datasource fields tab whether particular field is unchecked with lowercase.
    if checked all records you are pushing will have to be in uppercase.
    thanks
    Sankaresh S

  • When is the release date for the 5th generation iPod touch

    When is the release date for the 5th generation iPod touch?

    Nobody knows (except for apple of course). All it says on the ipod touch page that it ships in October so it could be any date. I predict that it is in the first two weeks of October but when it says buy it now instead of pre-order you know its about to come out.

  • Read error when reading the master data of 0EMPLOYEE on demand, attribute 0

    Hello All,
    While loading data for HR data source 0HR_PA_OS_1 i am getting the below error message..
    Error 1 in update.
    Read error when reading the master data of 0EMPLOYEE on demand, attribute 0COMP_CODE
    Please let me know how can it be resolved.
    Regards
    Rohit Parti

    The problem occurs during data load from R/3. It was not occuring before. When I go to check the PSA contents I get a runtime error - GETWA_NOT_ASSIGNED.
    Error analysis                                                      
        You attempted to access an unassigned field symbol              
        (data segment 32821).                                                                               
    This error may occur if                                         
        - You address a typed field symbol before it has been set with  
          ASSIGN                                                        
        - You address a field symbol that pointed to the line of an     
          internal table that was deleted                               
        - You address a field symbol that was previously reset using    
          UNASSIGN or that pointed to a local field that no             
          longer exists                                                 
        - You address a global function interface, although the         
          respective function module is not active - that is, is        
          not in the list of active calls. The list of active calls     
          can be taken from this short dump.

  • When is the release date for Windows 8.1 update?

    When is the release date for Windows 8.1 update?  You know I pay my bill every month so that my carrier can provide me with the best service.  And yet, I don't see any improvement in my service.  It seems like Windowsphone is an inconvenience to Verizon and that is the way they seem to be treating Windowsphone users.  Do you have the new Windowsphone in stock?  No, but it is available online.  Do you have any Windowsphone cases?  No but they are available in the the color you want online.  Screen protectors?  No the 928 screen protector will not fit the Icon, but let me cut up this other one and make it fit.

    This is the information I received via chat with customer service.  We aren't all hearing the same thing.
    >> Chat transcript removed to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • Overwriting the oldest data in the file

    Hi,
      I have a file of 10MB want to write in to file continuously overwriting the oldest data, my file size should be maintained 10MB and program may run for quite long time. since i am new to labview used file operations, shiftregisters and little queues but i am not getting any satisfactory results, hopping my problem is simple and someone could help me on this.
    Thanks,
    ranjan.

    Well, we earlier solved it for the 20MB case, so the 10MB case should be trivial to solve.
    What is the structure of the file, are all records of equal lenght?
    Yes, most likely the solution is simple! Maybe you can show us your code that produces unsatisfactory results and tell us what kind of results would be satisfactory.
    LabVIEW Champion . Do more with less code and in less time .

  • HT201406 1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc..

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

Maybe you are looking for

  • Synch my ipod touch 4 with a new hard drive

    I have a new hard drive - the old one crashed - how can I synch my ipod touch 4 with the new drive?

  • How to create subdirectories in playlist, ipod classic

    I am not familiar how to create subdirectories in Playlists in iPod Classic. Of course I have to user iTues software but I don't know how to create. Please guide me if anybody knows how to create subdirectories. I want like this (like windows how sub

  • Help with importing video; smaller F.O.V. than recorded.

    I am importing clips that I shot on my Canon EOS 60D. They are 1080p 24fps .MOV files. I may have trouble explaining my problem, so bear with me. The image that is given to me in Premiere is considerably smaller than what I originally recorded on the

  • Validation Model

    Hi, I�m on the final project of my degrees. I have to develop a system to generate client side validations and server side validations for n-tiers Java applications. The principal objective of the project is: write the validations rules ones and use

  • Question about unit conversion for BAPI_PO_CREATE1...

    Hello Experts, How do we bypass/supress the unit conversion in BAPI 'BAPI_PO_CREATE1'? Because what is happening right now is for example, I input in 88CV it will convert it to 'EA' as this is defined as the PO unit of measure. I want the 88 CV to be