Creating a converter for old serialized objects

Hi,
I have an application, which writes class objects to file, and then reads the class objects from file when the application is started up.
Now the problem is, that if i create/modify/etc fields in the class, then all my data is lost (i.e., i cant read the data in when the application starts)....
Now the docs state that a field can be added, and an old serialized object will still be recoverable...well for some reason this only works when it wants....i have tried several times, and its not a guarenteed thing....
So i was wondering, is there any way to create an application, which can grab an old serialized version of an object (i.e. class), have a copy of the old class, and the new class, and somehow cast the old to the new...or something of that sort?
thanks a lot!

This might be of some help:
http://www.onjava.com/pub/a/onjava/excerpt/JavaRMI_10/?page=5

Similar Messages

  • AMF3 references - do they reset for each serialized object?

    I have been writing some PHP code to handle AMF3
    serialization and deserialization so that I can pass objects back
    and forth over a socket. In trying to implement the
    AMF3
    specification, I'm having a bit of trouble with the concept of
    references. The
    OSFlash
    site has this to say:
    References are more prominent in AMF3 than in AMF0, and one
    should have two or three arrays to keep track of them, one for
    strings, one for objects and possibly one for class definitions
    (some combine the second and third array). References are
    per-body, so the reference arrays should be reset every time
    a new body is encountered (this can happen if calls are batched or
    if a /onDebugEvents body is sent.
    Does this mean that each time a serialized object is sent
    with a socket.writeObject(someObj) call that I need to reset these
    references and start from scratch? That would make A LOT of sense
    because otherwise, these arrays to track objects would grow QUITE
    large over time.

    You mean the lines below at Timer.java file?
    #if (taskFired) // Task fired; run it, holding no locks
    # task.run();
    That's true; run() method is called synchronously.
    It's a little bit confusing that TimerTask must implement
    the Runnable interface just for this purpose. It let me
    think that's another thread :))
    It could have been another interface which would probably
    be called "TimerContainer" or something like that.
    Anyway, thanks for info.
    java cannot do 'real-time' in any sense of the word.
    As for your question about threading in
    java.util.Timer...
    /me quickly glances at the src code.
    all the Tasks are executed from the same Thread
    synchronously.
    rob,

  • Is it possible to create the memory for a Java object in C/C++?

    Is it possible to have a C/C++ program allocate some memory, then have JNI use that memory for primitive java objects (such an array of bytes) that are passed to Java objects ?
    I would like to allocate a region of memory in C++, then give that memory to a Java object (via some kind of JNI type) and have that Java object fill the memory region with data.
    My impression from reading the JNI API and the few examples I've looked at is "No", there is a strict boundary between C++ and JNI as regards memory management. There may be serious implications as to why what I'm suggesting is not feasible, I am not enough of a JNI expert to know yet, and would greatly appreciate any input/comment.
    Many thanks,
    Colm.

    No, you cannot. However, writing your JNI code you should not use memory of Local Heap (if it possible). Because Local Heap Memory used also by JVM. I have developed tools that generate C++ wrappers for JNI code. In these wrappers I use mainly Global/Virtual Memory. I also reduce to minimum creation of local/global references, as it is affects to JVM memory use. If you are writing JNI code under MS Windows then you can try my tools that automate JNI code writing:
    http://simtel.net/product.php[id]93174[SiteID]simtel.net
    http://simtel.net/product.php[id]94368[SiteID]simtel.net
    Now I am developing this tool for .Net. In two weeks it will be finished.

  • How to create one form for two Udo object

    Hy ,
    I have two Object Udo (header and line)
    How we created a form to manage these two files (UDO)
    Thanks

    Thank you janos
    it works, I put the code to other developers for information
         Shared Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_application.ItemEvent
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "add") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    Dim oDS As SAPbouiCOM.DBDataSource
                    oDS = SBO_application.Forms.Item(FormUID).DataSources.DBDataSources.Item("@SIR_LOTL")
                    oDS.InsertRecord(oDS.Size)
                    oDS.Offset = oDS.Size - 1
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    oMatrix.AddRow(1)
                End If
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "del") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    For index As Integer = oMatrix.RowCount To 1 Step -1
                        If oMatrix.IsRowSelected(index) = True Then
                            oMatrix.DeleteRow(index)
                            oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                        End If
                    Next
                End If
            End Sub

  • Create new folders for old messages on my computer

    How do I create new folders in my computer to archive old messages and save them to my computer.

    Do you mean in Mail or the Finder? In Mail simply click on the [+] button at the bottom left of the folders fist. Select New Folder. In the dialog select where you want the folder located and the name for it.
    In the Finder navigate to where you want to create the folder then press SHIFT-COMMAND-N to create a new "untitled" folder.

  • Pls. help on AS2 to AS3 convertion for #initclip and Object.registerClass

    Hi Friends,
    I have converted most of the as2 code to as3 but I am stuck with the below kind of codes where the code looks like #initclip and some number next to it and inside it Object.registerClass("some reference", some reference); and ending with #endinitclip
    Below is an example of what I am talking about.
    #initclip 45
    Object.registerClass("Border", mx.skins.Border);
    #endinitclip
    Thanks in advance.
    With Regards,
    Sagar S. Ranpise

    SOLVED:
    Hey Friends,
    I was able to solve the issue. Since no one was able to give me answer, I think most of you might not be knowing the solution.
    Hence posting it below. All I have done is Added Event listener to instance name of movieclip and in the function I have imported the class the object.registerclass was refering and below import I created a new scrollbar instance and added that to my movieclip which solved the issue.
    Let me know what you think?
    boundingBox_mc.addEventListener(Event.ADDED_TO_STAGE, scrollbarFunction);
    function scrollbarFunction(e:Event):void
         // Import the class.
          import mx.controls.UIScrollBar;
          // Create the scrollbar
          var scroller:UIScrollBar = new UIScrollBar();
           boundingBox_mc.addChild(scroller);
    //Object.registerClass("UIScrollBar", mx.controls.UIScrollBar);

  • Do I even need an analog to digital converter for old VHS?

      I'm just trying the most cost effective way to transfer all of my old VHS & HI-8 material to a digital format for better preservation. Since, why I do not know, PE doesnt allow for analog capture, I need a converter like Dazzle to get my analog source to digital. Or do I?? Can I not just use Windows Movie Maker to capture then import into PE?  Doesnt my capture card do convert?? I have my VCR hooked up via S-video to the card. Is the card not the same thing as an external converter? I just want to know the best way so I dont waste my time only to have to go back and redo everything. Thanx yall

    Thanx y'all. Thats where I'm a bit confused. You mentioned "quality DV-AVI". I'm under the assumption that when I capture an analog signal that I set at 720x480 is a "quality DV-AVI". After I have captured and rendered to an .avi file I then import that into PE. Is that what you are meaning? Or is that an inferior quality video file? The capture card I have is a Legacy capture card that came with Pinnacle Studio ver 9. Pinnacle is a great intro level editor, but it sucks because it's slow, unstable and captures out of sync audio which I have to go in and manually sync. I shouldnt have to do that. I'll spend $100-$200 if thats what I have to do to get the results I want. I'm not looking for HD quality here. I simply want to capture all my old analog media, edit it, and burn to DVD and keep on my HD to preserve it all. I want it to be the same quality as it appears on its original medium.I also want to continue to edit and burn stuff using my Mini DV camera as well. I just want an editor thats above intro level, but not as complex as Premieire Pro. I feel that PE will do the job well. My capture card has S-video, firewire & composite inputs. Is my card not what I'm needing??  Or, do I need an analog to digital converter to get the analog material into a raw digital format thats the same quality as the original?
      To help in my endeavors i recently upgraded and built anew PC so that I would have no problems, seeing that video editing does tax a computers resources. My new build is a Quad core 4 gb of RAM system. So my computer power should not be an issue for home editing and what not.

  • Create Communication Reference for UART Serial COM and ETHERNET

    Hi All,
    I am developing a LV drivers for the device for which works on the both Serial COM and Ethernet. Commands used for both protocol are same just the commumcation choices are different.
    As it would be difficult to maintain, I do not want to develope drivers separtely for Serail COM and Ethernet so I must use the communcation reference for that, I plan to generate this reference in Initialize.vi  and further this reference is used for the communcation.
    How to generate this communcation rference ?
    Thank you.
    -Amit

    amitwadje wrote:
    Hi,
    Thank you for your answer, I do not want to use ONLY VISA, I agree most of the driver user knows about VISA very well but here my concern is to
    make the common driver both for COM port and Ethenet, just in Init.vi, I will select the COM or Ehtenet with proper inputs and accordingly
    communciation reference will be generated and the same communcation reference I will use for the further functionality (at that time, I do not
    care aobut what I am using COM or Ethernet as I have reference genered in Init,vi and I did input this reference for further VIs).
    is it possible to do so  ?
    Thank you.
    And VISA was speciifically designed to abstract the actual hardware interface away. It incidentially supports serial, GPIB, USB, AND TCP/IP for exactly that reason. Your Iniitilize.vi has to do only a little work to initialize certain aspects of VISA according to the used interface such as possible message termination and serial port parameters and the rest of the instrument driver simply gets the VISA reference and does its thing and doesn't have to worry at all if it should use the Serial COMM reference or rather the TCP/IP reference. In LabVIEW accessing Serial COMM without VISA is anyhow quite a bit of extra work.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to create a matt for art simple objects on white.

    I would like to edit with a bunch of photos of objects from a book. They were all shot against white. can I get rid of the white background? I'm running FCP5
    mac pro   Mac OS X (10.4.8)  

    You could try luma key. And be sure you have permission from the publishers to reproduce the images.

  • While creating Goods Receipt for multiple serial numbers it is generating an internal error

    Error:Internal error (-5002) occurred  [ 131-183]
    we are using version SAP B1 9.0 PL 4
    The code which we are using.
           Dim oPDN As SAPbobsCOM.Documents
           oPDN = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                         Dim serno As String = "SH-A1,SH-A2"
                        Dim sernoval As String() = serno.Split(",")
                        Dim mnfser As String = "SH-B1,SH-B2"
                        Dim mnfserval As String() = mnfser.Split(",")
                        For k = 0 To sernoval.Length - 1
                            oPDN.Lines.SerialNumbers.InternalSerialNumber = sernoval(k).Trim
                            oPDN.Lines.SerialNumbers.ManufacturerSerialNumber = mnfserval(k).Trim
                            oPDN.Lines.SerialNumbers.Quantity = linedetails(iRowNo).Quantity
                        Next
                    oPDN.CardCode = "C232323"
                    oPDN.Lines.ItemCode = "A00004"
                    'oGR.Lines.LineNum = 0
                    oPDN.Lines.BaseLine = 1
                    oPDN.Lines.BaseEntry = 202
                    'oGR.Lines.BaseRef = 203
                    oPDN.Lines.BaseType = 20
                    oPDN.Lines.Quantity = 1
                    oPDN.Lines.UnitPrice = 2
                    oPDN.Lines.WarehouseCode = '01'
                 oPDN.Lines.Add()
                 lRetCode = oPDN.Add

    Hi Vasanth,
    I'm not really fluent in VB, but I think that a SerialNumbers.Add() and SerialNumbers.SetCurrentLine() are missing before the Next
    Regards,
    Eric

  • Looking for old Business Objects Library Article C2014432.asp

    I have a problem, post November 4th, and have found a pointer to a possible solution, or at least some information. But I cannot find it. The reference was to:
    http://support.businessobjects.com/library/kbase/articles/c2014432.asp
    That link, of course, no longer works, and brings you here to the SAP forum area. I cannot find the article with any of the available search engines here. Can someone guide me to the current location for the article?

    Search here:
    https://www.sdn.sap.com/irj/sdn/businessobjects-notes
    No login necessary.
    Ludek

  • OID and binding java serialized object

    Hi there,
    How are you doing? I am trying to bind a serialized java object to a name in Oracle Internet Diectory (oid) using JNDI.
    it gives me an errror.
    "OperationNotSupported LDAPA error 53: Unwilling to perform:
    I have directory manager 2.1.1 and JNDI 1.2.1
    I arrpeciate any clue and/or help
    Thanks
    null

    Hello:
    Although OID supports calls from JNDI, the JNDI schema for storing JAVA serialized objects is not yet a standard part of the OID schema. This is easy to remedy. Go to javasoft.sun.com and download the JNDI schema for java serialized objects and load the attributes and objectclasses into OID from the ldif files provided at this web site. . Make sure the attributes are loaded before the objectclasses.
    Once this schema is loaded this problem should go away
    Use the ldapmodify command line tool to add the schema items from the ldif file.
    Let me know if you need further assistance setting this up. A future version of OID will contain these schema items standard.
    Thanks,
    Jay
    null

  • Converter-for-class

    Is converter-for-class or any other "-for-class" attributes required to match against subclasses of the specified class, or just the class itself?
    It you specify converter-for-class as Object, is the converter required to apply to every subclass of Object (i.e. every class), or just to those properties with a runtime value of exactly Object?
    Thanks.

    Hello BalusC,
    thanks for reply. I'm definitely use JSF RI 1.2_13.
    The problem is, that the converter-method public String getAsString( FacesContext p_ctx, UIComponent p_comp, Object p_value ) is never called.
    But the other method public Object getAsObject( FacesContext p_ctx, UIComponent p_comp, String p_value ) is called.
    BalusC, which JSF implementation do you use?
    regards, Joerg

  • Generic approach to call a method for any business object

    My requirement is to call the DISPLAY method of a business object when I have the objectType and objectId.
    Say I have BUS2012 and Id 4500001111, now I want to call a method which invoke the DISPLAY method for this object with objectId (say ME_DISPLAY_PURCHASE_DOCUMENT for purchase order). I even have the key fields for the business object.
    Is it possible ?
    Thanks in advance !
    Ruhi Hira

    Hi Ruhi,
               Yes you can call the method for display.Before we can do that we need to fix the procedure for the calling of the method.If you want to call it programitically or you want to call it in task builder or you want to use it as a activity in the work item.we can check for the BUSXXXXXX what ever number is there and we can also check for the activity type pre defined by SAP for it.If suppose you dont have the activity we can create the method for the BOR object type using SWO1.May be it helps your query.
    Have a best day ahead.

  • Writing serialized objects as XML

    What are the advantages and a disadvantages for writing serialized objects as XML instead of the Java binary format?

    Depending on the serialization scheme, XML can be used to loosely bind the persistant data, so that the class can change version, or even be replaced by a different class as the project requires refactoring over its lifecycle.
    It also allows non-Java tools to interact with your data, which almost always has a longer lifetime than any implementation. I still occasionally process SGML files from the '80s. If they had been in a proprietory binary format, that data would be far harder to re-use.
    Pete

Maybe you are looking for

  • File Dialog and CINs

    hello, Whenever i perform a file operation in LV, it crashes my CIN. I'm running LV 5.1.1 in Windows NT. Has anyone else ever had this problem before? I don't understand why it would be happening... When i debugged my CIN, the crash occurred when a f

  • After Effects: MP RAM Vorschau Problem bei Frame-Interpolationen

    Hallo Zusammen, ich nutze die neuste Version von After Effects CC unter Windows 7. Wenn Multiprocessing für RAM Vorschau aktiviert ist tritt bei mir folgendes Problem auf: Wenn ich Frame-Interpolation nutze, dann flackert die RAM - Vorschau zwischen

  • Can you replace the ssd drive in retina macbook pro with hdd inside of a bay of some kind?

    Hey guys, want to replace my 256 flash based drive in my 2014 macbook pro retina with a 1th 7200rpm hdd. Is this possible with a bay adapter of some kind?

  • Winmail.dat files

    I have been having some problems with receiving emails that have attachments (Word Docs), but I can't open them because they appear as "winmail.dat" and not an actual Word document. Is there a program that would help me to be able to read these?

  • Adding a Hotmail email to Mail

    i dont know how to add my @msn.com email to the mail software i think i do a POP but i dont know the Incoming mail server