Serialization using XMLEncoder/XMLDecoder - problems for SpringLayout

I am using JDK 1.4.0 (obviously, as I have problems with XMLEncoder... :o)
What I need to do is create a JFrame with some Swing components inside (JPanel's, JLabel's, etc.), to save it as an XML file and be able to restore it later.
Everything went OK at the beginning, but there came the time to manage the layout part. For various reasons, the most appropriate layout manager for my application is SpringLayout.
The first step was again OK: when defining a SpringLayout for a panel, this property was transferred to the XML by XMLEncoder and restored by XMLDecoder.
But then, the happy days are over! In order for a SpringLayout to work, one must obviously define lots of SpringLayout.Constraints, using Spring's. But none of these things are transferred by XMLEncoder to the XML.
And, quite naturally, even if I modify manually the XML to include some constraint info, the XMLDecoder won't read that info!
Does anybody know if there is any trick about this? Or is there a known bug concerning the serialization of Spring's, and you know about a workaround?
Thanks a lot,
Adrian

Hi Adrian, there are no persistence delegates defined for SpringLayout and its children.
I spent quite some time over the last six months trying to get SpringLayouts to save
correctly - but failed. There are two bugs in the way - both of which should be fixed for
1.4.1 (I think). One was in SpringLayout - the other in XMLEncoder itself:
http://developer.java.sun.com/developer/bugParade/bugs/4679556.html
One thing you said in your note that I thought Id comment on. You can edit the XML file manually
and this will (probably) lead to a solution. The XMLDecoder is an interpreter - it doesn't need access
to persistence delegates or require any knowledge of the swing APIs to work.
Hope that helps.
Philip

Similar Messages

  • Problem when use XMLEncoder/XMLDecoder avoid Serilization VersionID change

    I want to save my object in XML format,
    So I use XMLEncoder to write my object,
    And it will do well.
    But when my object has member with type of "java.sql.Date",
    (the date been getted from database).
    The XMLEncode can not save this member.
    What is the reason for it.
    How to solve.
    Thanks in advanced

    According to its documentation, XMLEncoder allows you to save JavaBeans. Unfortunately it doesn't bother to mention what a JavaBean is and doesn't provide a link to any documentation that explains that.
    One feature of a JavaBean is that it has a zero-argument constructor, so that you have a guaranteed way to create an object of that class. But java.sql.Date doesn't have a zero-argument constructor so it isn't a JavaBean. So it can't be saved by XMLEncoder.
    How to solve? Use java.util.Date instead.
    PC²

  • Impact of use XMLEncoder to log transactions that use serialization

    Hi,
    i have an application that uses serialization to communicate between client and server, i want to log this transactions in a xml file using XMLEncoder, using the method:
    public static void log(Object transaction) throws Exception {
            XMLEncoder e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("log.xml")));
            e.writeObject(transaction);
            e.close();
    }if i put this, how i can check the impact on the system? the XMLEncoder consumes memory to build the XML, then the impact will be only for the garbage collector?
    thanks for any idea.

    A profile would be the best option. NetBeans comes with a free one. There is also OptimizeIt and JProbe. Otherwise you'd have to write a lot of code to get that info.

  • SOS problem using one Entity bean for editing records. please help me

    Hello
    I have one great problem using one entity bean 2.1 and i am working with this problem several days and i dont solve it.
    i am using this jb 2.1 for add new records to one oracle database and for editing records.
    I have one great problem for editing records
    I have one objets that is as one of my database table. (PersonaObj.java)
         //personaObj.java
         public class PersonaObj implements Serializable{
              private Integer id_persona; //this ishte database table autonumeric
              private java.lang.String nombre;
              now the set/get methods.
         One field of this objets (bean) is the primary key of the table, and this field is one part of the pk from the entity bean.
         From one session bean i call the entity bena passing the objet
         into the entity bean (interface) i have one methods:
              public getPersona getT56aaat04();
         public void setPersona(PersonaObj obj);
         into the entitybean bean i have:
         public PersonaEntityPK ejbCreate(PersonaObj obj) throws CreateException {
              this.setT56aaat04(obj);
              public abstract Integer getId_persona();
         public abstract void setId_persona(Integer Id_persona);
         public abstract java.lang.String getNombre();
         public abstract void setNombre(java.lang.String Nombre);
         public PersonaObj getPersona() {
              PersonaObj obj = new PersonaObj();
              obj.setId_persona(getId_persona());
              obj.setNombre(getNombre());
              return obj;
         public void setPersona(PersonaObj obj) {
              setId_persona(obj.getId_persona());
              setNombre(obj.getNombre());
    But i have one graet problem.
    adding new record to the database i runs well but if i want to edit one recor appears this error:
    => Error <=
    java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException: EJB Exception: : java.lang.IllegalStateException:[EJB:010144]The setXXX method for a primary key field may only be called during ejbCreate.
    at PersonasEJB_a43o8n__WebLogic_CMP_RDBMS.setId_persona(PersonasEntityEJB_a43o8n__WebLogic_CMP_RDBMS.java:328)
    at PersonasEntityBean.setPersona(PersonasEntityBean.java:114)
    at PersonasEntityEJB_a43o8n_ELOImpl.setPersona(PersonasEntityEJB_a43o8n_ELOImpl.java:45)
    at PersonasSessionBean.editarPersona(PersonasSessionBean.java:849)
    at PersonasSessionBean_bszo9t_EOImpl.editarPersona(PersonasSessionBean_bszo9t_EOImpl.java:208)
    at PersonasSessionBean_bszo9t_EOImpl_WLSkel.invoke(Unknown Source)
    into the session bean i make this (the session recibes one PersonaObj obj):
    T56aContactosEntityLocal personaLocal ;
                   try {
                        personaLocal = personaHome.findByPrimaryKey(new T56aContactosEntityPK(obj.getId_a04()));
                        T56aaat04Obj objTmp = new T56aaat04Obj();
                        objTmp.setAp1_a04(obj.getAp1_a04());
                        objTmp.setEstado_a04("false");
                        personaLocal.setT56aaat04(obj);
    Please can you help me to solve this problem?

    Hello Werner,
    The mappings seem to be alright at a first glance.
    Have you tried out un- and redeploying your application? Sometimes values appear to be cached in the server. So if you have deployed the application before you entered DB_BANK as alias this might solve the problem...
    BR
    Daniel

  • I am using a work laptop and have the same problem. When I try to change the "configure proxy", they only available option is "use this proxy server for all protocols". Could it be that my system administrator blocked me from changing it since they don'

    I am using a work laptop and have the same problem. When I try to change the "configure proxy", they only available option is "use this proxy server for all protocols". Could it be that my system administrator blocked me from changing it since they don't want us to use Firefox.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.4; FNGP_SYS)

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • I have been using Elements 12 without a problem for 9 months.  Now when I try to open the program, I get an error message  "Adobe Photoshop Elements 12 quit unexpectedly" and it will not open at all.  What can I do to open the program?

    I have been using Elements 12 without a problem for 9 months.  Now when I try to open the program, I get an error message  "Adobe Photoshop Elements 12 quit unexpectedly" and it will not open at all.  What can I do to open the program?

    Thank you for responding.  Nothing actually worked!  After reading the posts online, I called Apple.  They indicated they have seen problems with some software after their upgrades.  The technician was able to fix the problem on my computer remotely, but I have no clue what he did!  But, it was definitely related to their recent upgrade to my computer.

  • I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage - I´d like to add an EMail account on top to my mobile number. My password will not be accepted!!!???

    I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage -
    I´d like to add an EMail account on top to my mobile number to use more this services. My password will not be accepted!!!??? I try it and i try it and i try ist, throughout the same problem. Whats on? The user help desk said, i´ve to reset and use the WLAN key new as well as possible - no way!

    Contact the App store for Apple ID help. Their support link is on the right of the App store window
    LN

  • Problem using Toshiba Software Installer for Win 7 on Satellite L750-1MT

    Hello!
    I have problem using Toshiba Software Installer for Win 7 on Satellite L750-1MT (PSK30E-02T002B3) with no OS preinstalled.
    I do the following:
    1. Install Windows 7 x64, SP1.
    2. Install LAN driver (device was not recognized by Windows 6) (downloaded from [http://se.computers.toshiba-europe.com/innovation/jsp/supportMyProduct.do?service=SE&LNG=26&userAction=S MP_RESULTS_PAGE&partNumber=PSK30E-02T002B3&serialNumber=&USER_ACTION=Serial%20number])
    3. Install all Windows Updates from Microsoft
    4. Run Toshiba Software Installer for Win 7 - it installs a couple of drivers and then asks to reboot.
    Here is the log file for the first try (win7update.log):
    Update started 12\28\2011 at 21:11
    Installed TVALZ_O.INF
    Installed IO & Memory Access Driver
    driver_bluetooth_TC00241200A.exe /s /log /test has been installed with the result code of PASS
    util_tvap_TC00215000H.exe /s /log /test /wait15 has been installed with the result code of PASS
    Update completed at 21:29
    After reboot I run it again and the result is:
    Update started 12\28\2011 at 21:38
    Toshiba Bluetooth stack has already been installed.
    Toshiba Value Added Package has already been installed.
    Update completed at 21:40
    Any help is appreciated!
    Thanks in advance!

    You are right this notebook model was delivered without OS.
    Win7 64bit is supported for this notebook model and all necessary drivers, tools and utilities are available on Toshiba download page.
    What I can say is that all this stuff must be installed in right install order. I know it sounds stupid now but I recommend you to make clean OS again and continue installation following this installation order:
    Win7 SP1
    Intel Chipset SW Installation Utility 9.2.0.1015
    TOSHIBA Supervisor Password Utility 4.8.6.0
    TOSHIBA HW Setup Utility 4.8.6.0
    TOSHIBA Bulletin Board V2.1.10
    TOSHIBA ReelTime 1.7.17.0
    Intel Management Engine Interface 7.0.2.1164
    NVIDIA Display Driver 8.17.12.6669
    Intel Rapid Storage Technology Driver 10.1.2.1004
    TOSHIBA Value Added Package 1.5.4.64
    USB3.0 Driver 2.0.32.0
    NVIDIA HD Audio Driver 1.1.13.1
    Conexant Audio Driver 8.51.1.0a
    Intel Wireless LAN Driver 14.0.2.2.1.s64_wCAT
    or
    Atheros Wireless LAN Driver 9.2.0.206.0.s3264_wCAT
    or
    Realtek Wireless LAN Driver 2.00.0013
    TOSHIBA Wireless LAN Indicator 1.0.3
    Synaptics Touch Pad Driver 15.2.11.1
    TOSHIBA Software Modem 2.2.97(SM2297ALS05)
    Conexant Modem Driver 7.80.4.53
    TOSHIBA HDD Protection 2.2.1.12
    Atheros Bluetooth Filter Driver Package v1.0.7
    Bluetooth Stack for Windows by Toshiba v8.00.04(T)
    Atheros LAN Driver 1.0.0.46
    Realtek Card Reader 1.0.0.12
    TOSHIBA Sleep Utility 1.4.2.7
    TOSHIBA Face Recognition V3.1.8
    TOSHIBA eco Utility 1.2.25.64
    Intel Proset 14.0.2.0.1.s64_wCAT
    Intel Wireless Display 2.0.29T
    TOSHIBA HDD_SSD Alert 3.1.64.7
    TOSHIBA Service Station V2.1.52
    TOSHIBA PC Health Monitor 1.7.4.64
    ConfigFree 8.0.37
    TOSHIBA Web Camera Application V2.0.0.19
    TOSHIBA Network Device ID Registry Setting Tool 3.0.32.4-14_wMSI
    TOSHIBA Media Controller 1.0.86.2
    TOSHIBA Media Controller Plug-in 1.0.6.1
    PatchFiles$$2 PCIIDEREG-1.2
    PatchFiles$$3 TosVolRegulator_x64_1.1
    It is very important to use right installation order.
    Please post some feedback.

  • Change transaction using BDC-problem for large number of lines on screen

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    *IF wa_qmsm_cntr > 2.
           wa_qmsm_cntr = 2.
           perform bdc_dynpro  using 'SAPLIQS0'                   '7204'.
           perform bdc_field   using 'BDC_OKCODE'                 '=PEND'.
    ENDIF.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N' UPDATE 'A'  MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?

    Hi yogesh,
    how can i ensure that correct row is modified?
    1. For this we need to know two things ;
       a) the database table in which the entries are already stored
       b) the sequence in which they are displayed in the transaction.
    2. So before changing any line, we need to compare (the primary key values / important values)
       a) as per the database table and as per the incoming data from web application (using bapi)
      b) if the match is ok, it means that particular row was not modified, else modified.
    how can i achieve problem of large no of lines on screen?
    1. For this I am  not sure about the transaction and its screen. Manytimes for appending row on the screen,
      there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
    hope this helps.
    regards,
    amit m.

  • I received a notification on my iphone recently that "Leroys Ipad" is now using my phone number for Imessage. The problem is the Ipad is in possession of my ex girlfriend and we no longer communicate. How do i receive Imessage on my Iphone only?

    I received a notification on my Iphone recently that "Leroys Ipad" is now using my phone number for Imessage. The problem is that i no longer have that Ipad but my ex girlfriend does and we no longer communicate. How do i receive Imessage on MY PHONE ONLY or delete other devices not in my possession from my messages?

    You need to change your Apple ID password.  You could login to Find My iPhone and wipe that iPad if you felt the need to do so.

  • The Adobe Photoshop CC 2014 - I can't use becouse is LOOCK DOWN the computer -  When USE is LOCK the computer so everything is LOCKING can't even move the mouse + need to restart the computer and use Photoshop CC 64 bit instead - have this problem for abo

    The Adobe Photoshop CC 2014 - I can't use becouse is LOOCK DOWN the computer -
    When USE is LOCK the computer so everything is LOCKING can't even move the mouse + need to restart the computer and use Photoshop CC 64 bit instead - have this problem for about 6 months ...

    Please read this (in particular the section titled "Supply pertinent information for quicker answers"):
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    http://forums.adobe.com/docs/DOC-2325
    Are you trying to use a 32bit version (I did not even know there is one for Photoshop CC 2014)?
    If so – why?

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • I've a problem which is: Ibelieve there's someone who knows my password in some games like "Happy Day" so, could you please help me by not letting anybody to use this game except for this IMEI 01 336000 521261 1 even if they have the correct password.

    I've a problem which is: Ibelieve there's someone who knows my password in some games like "Happy Day" so, could you please help me by not letting anybody to use this game except for this IMEI 01 336000 521261 1 even if they have the correct password. Thanks alot for your help.

    Change your password.
    These are user forums. We can't do what you ask, in fact no one can.

  • 4S ios updated to 7 is giving me problems for using wifi Thus it is difficult for me to use internet. The wifi comes on for a while and goes off in a few minutes The phone is unable to scan networks available for use

    4S ios updated to 7 is giving me problems for using wifi Thus it is difficult for me to use internet. The wifi comes ON for a while and goes off in a few minutes The phone is unable to scan networks available for use
    Am having ipad2, ipad mini and iphone 4 with family of two persons. One hp laptop and a DELL professional computer also in operation
    Myself an engineer for projects
    Looks the company apple cannot grow if they do not support solving the problems of their existing customers
    Ashok Dhingra
    India

    You are not addressing Apple here. If you have a problem, describe it and someone might be able to help. Just to be sure, the wi-fi on the phone will go off after the phone goes into sleep mode unless it is actively being used. This is a battery saving measure. If you are actively using the internet, and the phone is still awake, then the wi-fi should remain connected.
    What troubleshooting steps have you tried.

  • Problem for using oracle xml parser v2 for 8.1.7

    My first posting was messed up. This is re-posting the same question.
    Problem for using oracle xml parser v2 for 8.1.7
    I have a sylesheet with
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">.
    It works fine if I refer this xsl file in xml file as follows:
    <?xml-stylesheet type="text/xsl" href="http://...../GN.xsl"?>.
    When I use this xsl in pl/sql package, I got
    ORA-20100: Error occurred while processing: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    After I changed name space definition to
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> in xsl file, I got
    ORA-20100: Error occurred while processing: XSL-1019: Expected ']' instead of '$'.
    I am using xml parser v2 for 8.1.7
    Can anyone explain why it happens? What is the solution?
    Yi

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Element's dont have text content, they [b]contain text node children.
    So instead of trying to setNodeValue() on the element, construct a Text node and use the appendChild method on the element to append the text node as a child of the element.<HR></BLOCKQUOTE>
    Steve,
    We are also creating an XML DOM from java and are having trouble getting the tags created as we want. When we use XMLText it creates the tag as <tagName/>value rather than <tagName>value</tagName>. We want separate open and close tags. Any ideas?
    Lori

Maybe you are looking for