Transform objects on (de)serialization

Hi,
I would like to know if it is possible in principle to transform/mutate/repack an object to another object such that it belongs to a different class.
Scenario: I want to pass a list of groovy objects POGOs to an applet. These groovy objects however have groovy.lang.GroovyObject as its root parent and not java.lang.Object. I don't want to have the applet load the whole groovy runtime and I want to avoid an extra repack step. So the idea is that the serialization (writeObject(), readObject()) does the magic of transforming the POGOs (Groovy) to POJOs (Java). Is that possible or are there some fundamental barriers?
Thanks
fatzopilot

Hi ejp,
thanks for the hints. I use writeReplace() {return new BrokerObject) in my class (which is serialzable and has a fixed UID) on the server-side to generate a broker object that then should be passed to the client. The broker object is defined in an external jar which is in the classpath of the client (javaFX) and server (groovy/grails) project. It is marked serializable and as well has a fixed UID. However, I get an
{code}
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
     java.io.EOFException
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173).
on the client side.
What puzzles me even more:
When I usewriteReplace() {return this.toString())
{code}
I can receive the resulting String without problems on the client side.
However, when I use
writeReplace() {return new String(this))I also get the above error.
It seems, there is some kind of incompatibility when a new Object is created. Any ideas?
Cheers
fatzopilot

Similar Messages

  • Is there a graphics program (such as Photoshop) that works on the iPad ? I need to warp, skew, transform objects. Any advice?

    I need to warp, skew and transform objects. Need advice .

    http://www.macstories.net/reviews/adobe-photoshop-touch/
    https://itunes.apple.com/us/app/adobe-photoshop-touch/id495716481?mt=8
     Cheers, Tom

  • MIDI Transformer Object

    Is it possible to have the transformer object in the environment combine a note and a MIDI CC value and output different notes depending on the range that the CC value falls into? I'm trying to convert the hi-hat output from my V-drums into several different notes. Hitting the hi-hat pad produces the note A#2 and moving the pedal up or down generates data on CC#4 (in order to gradually progress from open hi-hat to closed hi-hat.) Superior Drummer and other plugins support hi-hat CC data out of the box, but I want to use Addictive Drums which doesn't support this. Basically, I want to implement some simple if statements. So for example:
    - IF incoming note = A#2 and CC#4 is between 1 and 30, output note X
    - IF incoming note = A#2 and CC#4 is between 31 and 60, output note Y
    and so on...
    Is it possible to do this in Logic? If it can't be done with out of the box environment objects, is there any way to program objects for Logic, or MIDI plugins? I have plenty of programming experience but haven't been able to find much on extending Logic with MIDI plugins.

    Again, the answer is yes. Unfortunately, as far as I know, you can't do this in one operation.
    IF incoming note = A#2 and CC#4 is between 1 and 30, output note X
    IF incoming note = A#2 and CC#4 is between 31 and 60, output note Y
    Will have to be done along these lines.
    transformer 1: Status = Note: Pitch = A#2: Mode = Condition splitter(True -> top cable)
    top cable to transformer 2
    transformer 2: Status = Control: Data Byte 1 >= 30 (whichever > means less than; (it's late)): Mode = Condition splitter(True -> top cable)
    send the lower cable from transformer 2 to transformer 3
    set transformer 3 as for transformer 2 except Data Byte 1 >=60
    You could end up with quite a complex chain of transformers. Don't worry; if they are set up correctly, they will do what you want with little or no latency.
    I have used these type of commands combined with delays to create a complete arrangement for piano, synths, bass & drums from a single note. It was an interesting exercise.
    I hope this makes sense & that it helps you sort out your problem.

  • Error when transforming object data HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi
    I am running on NW04s. Working on WD for ABAP Interactive forms. whenever I open the Adobe editor thru SFP or Se80,  the editor opens up and I am able to do my operations. The moement I hit back button/Save or any other action which involves coming out of the adobe editor, it throws me an Fatal error - <b>Error when transforming object data</b>. I find that in most of the threads there are similar issues which are still open. Any Help would be appreciated.
    I have installed ADLC 7.1, xACF04s.
    Murali.

    I did the same installation on another PC, and to my suprise it works fine. Looks very strange

  • Adobe Forms Error Message 'Error when transforming object data'

    Hi,
      When i tried to save(Adobe Forms) after making changes in Layout its giving an error message 'Error when transforming object data' and takes me out of the transaction. How do i solve this ? Can anyone help me out.
    Thanks and Regards,
    Franklin.

    hi
      I have the same problem , plz help me out
    thanks

  • Testing Object Equality using Serialization

    Hey everyone! I was wondering if somebody could help me figure out how to compare two objects using serialization.
    I have two objects that I'm trying to compare. Both of these objects extend a common "Model" class that has a method getSerialized() that returns a serialized form of an instance, shown below:
              // Serialize the object to an array
             ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
             ObjectOutputStream oos;
              try {
                   oos = new ObjectOutputStream(baos);
                  oos.writeObject(this);
                  oos.close();
              } catch (IOException e) {
                   e.printStackTrace();
             //Deserialize array into a String array
             return baos.toByteArray();This Model class also has an equals(Model obj) method that allows for the current model object to be compared to a model object that is passed in:
            //Store both models' serialized forms into byte arrays
            byte [] thisClass = this.getSerialized();
            byte [] otherClass = obj.getSerialized();This is where things get a little funny. The byte arrays don't equal - one array is a byte larger than the other. If a byte-by-byte comparison is done, the arrays are equal for the first 15-20% and then not equal for the rest. If I deserialize the byte arrays back into Models and do a toString() on those models, I find that they are equal.
    I have a feeling there's something about the serialization process that I don't fully comprehend. Is there a way to properly implement object comparison using serialization?
    Thanks in advance!

    When you serialize an object, you also serialize the entire tree of references based on that object (except for transient variables). That tree is the complicated business you described there. Serialization stores all the objects in the tree, along with data that explains which objects refer to which other objects. Furthermore if the tree is actually a graph, and there are multiple ways to get to an object, it still only stores each object once. I don't see any reason to believe that all that relationship data would be encoded identically for a pair of trees that you deemed to be equal. And your experiment shows that indeed it isn't.

  • Transformer object problem

    Hi, my first post!
    I'm using a transformer-object in the environment to transpose
    some incoming midi-notes in real time.
    This works so far, but somehow, all the notes that are played, 'hang'
    for some reason, like no 'note-off' command is been given.
    Also, when a note is triggered, a second note is triggered at release and
    being displayed in the matrix-editor.
    Is there anyone who can help me out?
    I'm stuck!

    You can transpose incoming data using the playback parameters box by deselecting all regions to display the parameters for the MIDI thru and setting a transpose value. Might be less buggy.

  • Transformer object- fix note problem

    Hi, my first post!
    I'm using a transformer-object in the environment to transpose
    some incoming midi-notes in real time.
    This works so far, but somehow, all the notes that are played, 'hang'
    for some reason, like no 'note-off' command is been given.
    Also, when a note is triggered, a second note is triggered at release and
    being displayed in the matrix-editor.
    Is there anyone who can help me out?
    I'm stuck!

    How I'd probably tackle it is to filter out all the note offs from the input stream first, do my processing to modify/transform whatever notes etc I needed, and add back in the necessary noteoffs when I finally pass the converted notes to the instrument - this won't in general be a problem with drum voices because they largely ignore note-offs anyway, as drum voices don't generally respond to gate time.
    That way I know I always have a matching note-off following a note, and it's easier than trying to process the note-offs separately to match your note on processing, and keep everything in sync.
    To generate note offs for a note on event, pass your modified note-on only MIDI stream to a final transformer, and the use "copy matching events" in whichever order you need, leaving the note pitch to THRU, and setting the velocity to zero, so every incoming note will pass through the transformer, followed by it's associated transformed note off.
    If you have problems setting this up, post back and I'll take a look...
    Edit: Hmm, transformers won't let you fix a note velocity to zero, at least in LP8. That's annoying.
    I know I've done stuff like this before - I need to wait until I've got some clear head time to look at this... I think I ended up converting notes into other data types before converting them back into notes, specifically to break Logic's attempt at handling notes atomically, but can't remember offhand...

  • All session objects should be serializable to replicate error.

    Hi All,
    Having 'EmployeeBean' and it is having below properties with getters and setters methods
    private long emp_id;
    private String emp_name;
    private java.sql.Timestamp date_of_join;
    private boolean isActive;
    private int dept_no;
    Adding multiple employees(creating multiple EmployeeBean) into an ArrayList and storing this ArrayList into a Session object. This is working fine but when I move this code to production(cluster environment) it is throwing below error
    <Aug 23, 2011 2:15:40 PM EDT> <Error> <Cluster> <BEA-000126> <All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.
    java.rmi.MarshalException: failed to marshal update(Lweblogic.cluster.replication.ROID;ILjava.io.Serializable;Ljava.lang.Object;); nested exception is:
         java.io.NotSerializableException: my.company.beans.EmployeeBean
         at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:90)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:221)
         at weblogic.cluster.replication.ReplicationManager_1032_WLStub.update(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.NotSerializableException: my.company.beans.EmployeeBean
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
         at java.util.ArrayList.writeObject(ArrayList.java:570)
         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         Truncated. see log file for complete stacktrace
    Can someone please let me know, why I'm getting this error? The EmployeeBean should implement serializable? Is there any problems/cons to implement serializable?
    Having other bean(LoginBean) and I'm keeping this bean into session and it doesn't implement serializable, not getting any error for this bean(LoginBean). Only difference is LoginBean is not added to ArrayList.
    Why it is throwing error for EmployeeBean and not for LoginBean??
    Thanks in advance.
    Regards,
    Sharath.

    The EmployeeBean should implement serializable? - Yep Is there any problems/cons to implement serializable? - No
    Just add java.io.Serializable to the EmployeeBean, for example,
    public class EmployeeBean implements Serializable {
    }For LoginBean you have probably, configured to be in the session, by using faces-config.xml.
    In the case of EmployeeBean (or the object graph it is part of) have you used HttpSession.setAttribute(...)?
    Note that setAtttibute(...) is the trigger for an application server to replicate the object.
    In this case all objects in the object graph have to be serializable.
    Typically, objects should be Serializable when they are part of the session and you are using a clustered environment.

  • Error creating transformer object after server up for 2-3 days

    Our application performs various XSL Transformations and as such it needs to create Transformer objects to perform the transformations. All works fine for several days (usually 2-3 days) then we begin to receive this exception:
    {color:#0000ff}java.lang.ArrayIndexOutOfBoundsException: 5
    at net.sf.saxon.om.NamespaceIterator.getInScopeNamespaceCodes(NamespaceIterator.java:288)
    at net.sf.saxon.tree.ElementImpl.getInScopeNamespaceCodes(ElementImpl.java:670)
    at net.sf.saxon.style.LiteralResultElement.validate(LiteralResultElement.java:200)
    at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1234)
    at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1263)
    at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1238)
    at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1263)
    at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1238)
    at net.sf.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:705)
    at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331)
    at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163)
    at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)
    at weblogic.xml.jaxp.RegistryTransformerFactory.newTemplates(RegistryTransformerFactory.java:173)
    {color:#000000}It's a very odd problem. It doesn't seem to be an issue with memory as there is memory free and some XSL transformations still work okay. There doesn't seem to be an issue with any particular style sheet, it rather random. Once a style sheet starts to fail, it doesn't ever work. If I restart the application server everything is back to normal.
    {color}
    We use Saxon9 and we use WebLogic's XML Registry to configure our XML/XSL implementing classes. Here is what that looks like:
    Name:SAXON
    Document Builder Factory:weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl
    SAX Parser Factory:com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
    Transformer Factory:net.sf.saxon.TransformerFactoryImpl
    When To Cache:cache-never
    Here is our WebLogic Information:
    WebLogic Version:WebLogic Server Temporary Patch for CR328282 Thu Nov 08 13:39:13 EST 2007 WebLogic Server Temporary Patch for CR345092 Wed Oct 24 10:56:58 IST 2007 WebLogic Server 9.2 MP2 Mon Jun 25 01:32:01 EDT 2007 952826
    Java Vendor:BEA Systems, Inc.
    Java Version:1.5.0_10
    OSName:Linux
    OSVersion:2.6.9-78.0.8.ELsmp
    {color:#000000}We upgraded from saxon8 to saxon9 in the hopes of resolving this issue, but we still get the same error message.
    {color}
    {color:#000000}I'm wondering if something is going on with WebLogic's XML Registry?
    I've tried to cause this problem to occurr by stress testing the application, but no such luck yet.
    Any ideas?
    Thanks!
    Paul{color}
    {color}

    We are facing a very similar issue. The ditto configuration and the same issue. This issue disappears when we recycle the weblogic.
    Can anybody give me a reply if this issue was sorted out? Any help would be appreciated. Incase if this issue was solved somewhere in threads, please give me an idea. Thank you in advance.
    Regards!!
    Jai

  • How to keyframe 3D transform objects in Motion

    hello,
    i cant seem to find how to keyframe a 3d transform object in my project?
    i have a text object that id like to spin in 3d but i cant seem to find where to keyframe in the inspector or timeline...
    thanks!
    steven

    hi,
    I dont want to appear rude but have you looked in the manual under keyframes?
    If you highlight the text object ( maybe better the layer its in in case you want to add more text later),
    and hope over to the inspector you can click on the triangle next to the rotation parameter to show all three degrees of rotation. You can add keyframes by clicking the contextual manual to the right of the parameter or by turning on the big red button and manually moving the object.
    Or instead of keyframing you could add a spin behaviour to the object.
    hth
    adam

  • Lost Object[] data after serialization

    Hi all,
    I posted this problem already in the servlet forum, but now I found out that it's more a serialization problem. I hope you guys can help me!!!!
    I have a problem sending a serialized object from a java application to a servlet (inside Tomcat).
    I'm using Commons HttpClient's PostMethod to get a connection to the servlet over https. The encryption should be done automatically within HttpClient and Tomcat.
    The object container I'm sending contains a few Strings and an Object[] that is filled with Strings.
    The container i'm sending implements Serializable.
    The connection is working fine, and the object has no serialization problems but the incoming request at server-side is kind of broken.... The single Strings are the same I've set on client-side, but the Object[] is null. I tried it with directly sending the ArrayList but with the same result.
    The size of the incoming data stream is the same as it was on client side.
    The funny thing is that sending data back from server to client works perfectly fine. My Object[] goes through without any problems!
    Here is the client code I'm using:
    PostMethod method = new PostMethod(mServerUrl);
    MyContainer container = new MyContainer("Message2Server",new Object[]{"ArrayElement1"});
    ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
    ObjectOutputStream serializer = new ObjectOutputStream(byteStream);
    serializer.writeObject(container);
    serializer.flush( );
    serializer.close();
    method.setRequestHeader("Content-Type","binary/x-java-serialized");
    ByteArrayRequestEntity output = new ByteArrayRequestEntity(byteStream.toByteArray());
    method.setRequestEntity(output);
    mClient.executeMethod(method);...and here is the servlet code:
    InputStream is = request.getInputStream();
    ObjectInputStream ois = new ObjectInputStream(is);
    MyContainer out = (MyContainer) ois.readObject();
    out.getString1(); //<-- is OK!
    out.getString2(); //<-- is OK!
    out.getObjectArray(); //<-- is null!!!!!!
    out.setObjectArray(new Object[]{"Message for the Client!!!"});
    response.setContentType("binary/x-java-serialized");
    // get output stream and send it back
    OutputStream os = response.getOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
    oos.writeObject(out);
    oos.flush();
    oos.close();Does anybody see a solution????
    I think it just could be two things:
    - Serialization fails for any reason?!
    - The Servlet InputStream fails?
    Thanx for any help!
    CU Jan

    This looks very useful to me. Can you tell us what
    the typo was?Considering he/she hasn't posted for 4 months, I'd doubt it.

  • Cropping of excess transformed objects

    My problem is as follows:
    I have created a series of circles starting with a base circle then using two transform operations -- one to copy it down then another to copy the whole set across.  So that leaves me with a grid of circles.
    I have created an irregular clipping mask to restrict the circles to within the area of the clipping mask (blue sploosh)
    Everything looks fine in illustrator.  I have included a snapshot here with the clipping mask released so that you can see the objects being worked with.
    The problem comes in when I go to copy & past that artwork into photoshop.  What I get is the full spread of (clipped) circles which messes up sizing inside photoshop.  The clipping mask hid the excess circles but it did not get rid of them.  I have further tried using the pathfinder crop tool but that doesn't seem to work with transformed objects.  Does anyone have any suggestions as to how I can get rid of the spare inner circles so they are really gone and not simply hidden by the clip mask?

    @Jacob
    Thanks.  That was helpful in that it was the first time I've seen anything which was actually able to destructively get rid of the spares. The downside is that for reasons unknown the "blueness" from the sploosh underneath was removed... or more accurately, the it put a white background underneath the clipped circles.  If I turn off the circles group then the sploosh is visible underneath.  I fooled around with other options on the Object -> Flatten Transparency dialog and found I got more pleasing results by enabling Preserve Alpha Transparency but the things like the drop shadow just turned awful.  I'd be way better off to just manually drag circles around. 
    That, at least, gave me SOME Illustrator operation that had some effect on the extra circles created by Effect -> Distort & Transform -> Transform option
    As you can probably tell, I'm a photoshop guy struggling to learn Illustrator.  I find myself partly awed at some of the things it can do and greatly annoyed at silly things like this (and don't even get me started on how awful the bevel options are in Illustrator vs. photoshop LOL).
    At least for the short-term I have a working vector image.  I can pull it into photoshop, rasterize it, then get rid of the spare bits... or simply ignore them since they are invisible.

  • Error Dump Creating a Transformation Object

    Hi all:
    I have NW2004s  in my box.
    I have the following error when trying to create a Tranformation Object (function "Create Transformation"  on a Data Source).:
    "Make sure that the OCXs ICDataFlow.ocx and wdbdadpt.ocx are installed on your computer....".
    Installation went ok, with no errors, so I don't know why the system is asking for additional files.
    If so, what should I do?...What should I check?
    Thanks in advance.

    You don't have access to :
    http://service.sap.com/notes
    or SAP Notes through CSS ?
    Then, it will be difficult as some notes have corrections that need to be implemented and you do need the access.
    Best Regards,
    Snehal

  • [Transport transformation]: Object not found in Transport Connection.

    Dear All,,
    Would you like kindly help me please .. ???
    I have transformation in development that's going to be trasnported to Production.
    But somehow, when i go to transport connection, i couldn't find the object there.
    The tranformation that i can't see, the transformation that link between datasource and info source. But transformation linking Info source to info provider can be found.
    I've already done:
    1. Reactivate the object ( i edit, and i activate it).
    2. Logging off the system, and log on again.
    But for those techniques, i'm still unable to find the object in transport connection .
    Could you help me please ??
    Is it caused authorization ?? If yes, what authorization made me unable to see it .. ??
    Best regards,
    Daniel N.

    HI
    Recheck your Collection of Object at Transport Request , Make sure that you have selected before / after DS because you can only see After Info Source ..
    Recollect the objects at Source system and transport them to Target System again Properly.
    Transports -Procedure
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3010ba90-0201-0010-2896-e58547c6757e
    http://help.sap.com/saphelp_nw2004s/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    others
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e883de94-0501-0010-7d95-de5ffa503a86
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/57/38e1824eb711d182bf0000e829fbfe/frameset.htm
    Re: Transport Organizer---
    transport query (bex objects)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/38/5ee7377a98c17fe10000009b38f842/frameset.htm
    Hope it helps and clear.

Maybe you are looking for

  • Safari keeps crashing on launch ...

    Hi Guys ... i uploaded Maverick a few weeks ago ... so far so good until today!  For some reason Safari has suddenly started crashing on launch ... has any one else experienced the same problem recently with any ideas on a fix? Here's the report that

  • Is this possible? View photos in full screen and navigate using cursor

    Recent convert from PC. Love the mac thus far but this is driving me crazy. What I am trying to do is to view pictures (in a folder) in full screen and be able to navigate either using the left-right cursor or some kind of buttons on the screen. Here

  • Date offset in Linux calendar

    Hello, I have written a bean to create a calendar. I tested the jsp in windows and it works fine, but when uploaded to a debian linux server the dates populated are a day earlier. For example the program updates working days monday to friday on windo

  • Error Code when trying to burn cds

    Hi i have tried to burn cds using my iMac but for the last while i have been getting the same error , "burning of the disc failed because communication to the disc drive failed. Error code 0x80020022" this error appears if i try to burn music cds or

  • Aperture 3 import of iphoto library

    i downloaded a trial version of Aperture 3 but it does not appear to see my iphoto library (just music and photo booth in in Pictures folder)