Object (which has non-serializable attr.) serialization

i could not solve object serialization problem in anyway. how can this be performed without "java.io.NotSerializableException"?
import java.awt.Image;
import java.awt.Toolkit;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
public class Object2ByteArray {
    public static void main(String[] args) {
        Object2ByteArray obj2ba = new Object2ByteArray();
        AnObject anObj = obj2ba.new AnObject();
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            //FileOutputStream fos = new FileOutputStream("C:\\obj.file");
            ObjectOutputStream oos = new ObjectOutputStream(baos); //or (fos)
            baos.writeTo(oos);
            oos.writeObject(anObj);
            oos.flush();
            byte[] objInBytes = baos.toByteArray();
            System.out.println("An object (which has a non-serializable element[Image]) is written to ObjectOutputStream.");
        } catch (IOException e) {
            e.printStackTrace();
    public class AnObject implements Serializable {
        Image img = Toolkit.getDefaultToolkit().getImage("C:\\anil.jpg");
        int c = 10;
        String desc = null;
}

Hi,
No, transient means that the attribute won't be sent over the stream. You usually declare fields that you don't want to send, or can't send as transient.
/Kaj

Similar Messages

  • Activation error on Multi Provider which has Non-cumulative Cube

    Hi,
    My company has upgraded the BI 7.0 from 3.5.
    It is working fine so far.
    But I met the below message and could not activate it when I generate the multi provider which has Non-cumulative Cube.
    Define the characteristics of the validity table for non-cumulatives (Message no. R7846)
    And then I checked the Single cube but Single cube has no error.
    I think this is program error and searched the notes in OSS but could not find.
    Does any expert know this issue?
    Thank you.

    Hi lee,
    validity slice tables need to be defined for cubes using non cumulative key figures.
    In this we need to specify the characteristic combination on which this table has be maintained.
    The maintanence can be done from cube change mode, menu bar extras--> maintain non cumulative values.
    This table constantly gets updated with validity dates as we upload data.
    An report on this can be seen in tcode RSDV.
    Naveen.A

  • Last active change request of a object which has been transported

    Hi to all,
    I need a method to obtain the last active change request of a object which has been transported to the corresponding target system. I know that the CR tables are E070 and E071, but how can I know the last active and transported CR of each object? Any suggestion?
    Thank you very much,
    Antonio

    Hi Antonio, As u are aware that you can get TR information from E070 and E071 tables.From these two tables we can get the latest TR. In table E070 there are two fields with AS4DATE, AS4TIME.So, U can find the latest transported object on these two fileds.Also, u need to check the TRSTATUS field which specifies whether the object is transported ( R Released) or still Modifiable( Active as D).
    However this table will also contains subtasks and main request. This can be diffrentiated with the help of STRKORR field of E070. If blank then its a main req else its a subtask where the field would contain the Main Request No.
    Hope this would be of some help for u r development.
    Regards,
    Swaroop

  • Extending the BC4J objects which has private methods

    Hi,
    I faced a situation which requires to extended the AM and CO of a page which has some private methods.
    As we cant inherit the which private methods of a class I thought of using the same code in the extended class.
    As it is not feasible solution n not upgrade safe we have not taken up the development..
    Any one faced the same issue and any workaround on the same will be appreciated..
    Thanks,
    Nagu

    Copy the private method code into your extended objects. Then it'll use the private methods in your extended code....

  • Using a Circle object which has been created outside a Group

    Hi all!
    I have one trouble:
    I create a Circle object outside a Group object.
    I trying to use th Circle in the Group and I have got compilation error.
    It's my code:
    * testfx.fx
    * Created on 24.03.2009, 21:19:00
    package testfx;
    import javafx.scene.effect.*;
    import javafx.scene.paint.*;
    import javafx.scene.shape.*;
    import javafx.scene.*;
    import javafx.scene.text.*;
    import javafx.scene.control.*;
    import javafx.scene.transform.*;
    import javafx.stage.Stage;
    var MyCircle : Circle = Circle{
        centerX: 200
        centerY: 200
        radius: 15
        fill: Color.BLUE
    function run(){
        Stage {
            title: "Button"
            width:400
            height:400
            scene: Scene{
                fill: Color.BLACK
                content:[
                    Group{
                        content:[
                            Rectangle{
                                x: 125
                                y: 175
                                width: 150
                                height: 50
                                arcHeight: 5
                                arcWidth: 5
                                stroke: Color.GRAY
                                fill: LinearGradient{
                                    startX: 0.0
                                    startY: 0.0
                                    endX: 0.0
                                    endY: 1.0
                                    proportional: true
                                    stops:[
                                        Stop{offset: 0.0 color: Color.WHITE},
                                        Stop{offset: 1.0 color: Color.BLACK}
                            MyCircle                           <------- (SIC!)    
                        effect: Reflection{
                            fraction: 1.0
                            topOffset: 3
                            topOpacity: 0.8
                            bottomOpacity: 0.2
    }My error:
    Note: The following error is an internal error in the OpenJFX compiler (1.1.0).
    Please file a bug at the Openjfx-compiler issues home (https://openjfx-compiler.dev.java.net/Issues) after checking for duplicates. Include the following diagnostic in your report and, if possible, the source code which triggered this problem. Thank you.
    Where is my mistake here?
    I'm sorry for my English, I have not enough knowledge in it at the moment.
    //Best regards!
    //Alexander

    Try this:
    package testfx;
    import javafx.scene.effect.*;
    import javafx.scene.paint.*;
    import javafx.scene.shape.*;
    import javafx.scene.*;
    import javafx.stage.Stage;
    var myCircle : Circle = Circle{
    centerX: 200
    centerY: 200
    radius: 15
    fill: Color.BLUE
    Stage {
    title: "Button"
    width:400
    height:400
    scene: Scene{
    fill: Color.BLACK
    content:[
    Group{
    content:[
    Rectangle{
    x: 125
    y: 175
    width: 150
    height: 50
    arcHeight: 5
    arcWidth: 5
    stroke: Color.GRAY
    fill: LinearGradient{
    startX: 0.0
    startY: 0.0
    endX: 0.0
    endY: 1.0
    proportional: true
    stops:[
    Stop{offset: 0.0 color: Color.WHITE},
    Stop{offset: 1.0 color: Color.BLACK}
    myCircle
    effect: Reflection{
    fraction: 1.0
    topOffset: 3
    topOpacity: 0.8
    bottomOpacity: 0.2
    By the way, you could define the Circle inline, like this:
    package testfx;
    import javafx.scene.effect.*;
    import javafx.scene.paint.*;
    import javafx.scene.shape.*;
    import javafx.scene.*;
    import javafx.stage.Stage;
    Stage {
    title: "Button"
    width:400
    height:400
    scene: Scene{
    fill: Color.BLACK
    content:[
    Group{
    content:[
    Rectangle{
    x: 125
    y: 175
    width: 150
    height: 50
    arcHeight: 5
    arcWidth: 5
    stroke: Color.GRAY
    fill: LinearGradient{
    startX: 0.0
    startY: 0.0
    endX: 0.0
    endY: 1.0
    proportional: true
    stops: [
    Stop{
    offset: 0.0
    color: Color.WHITE
    Stop{
    offset: 1.0
    color: Color.BLACK
    Circle{
    centerX: 200
    centerY: 200
    radius: 15
    fill: Color.BLUE
    effect: Reflection{
    fraction: 1.0
    topOffset: 3
    topOpacity: 0.8
    bottomOpacity: 0.2
    Thanks,
    Jim Weaver
    JavaFXpert.com (Learn JavaFX blog)
    Edited by: JimWeaver on Mar 25, 2009 1:15 PM
    Edited by: JimWeaver on Mar 25, 2009 1:17 PM

  • Duplicated document with the smart object which has a DNG file inside it

    A TIFF file has a DNG file as a smart object inside it ...
    If you duplicate this file, the smart object can not be opened any more.
    Any idea?
    Thanks ...

    I've looked at it again for TIFF after reading your post ... it is working now

  • Assign the Bookmark Tag from 1 site to another site which has none

    The majority of the Web Sites which I've Bookmarked have Tags assign [assume they did it themselves]. But, a few of mine have none whatsoever. How can I use another site's Tag since they are similar in nature (i.e. Health, Exercise, Food, etc.)

    Anton ~ iWeb stores everything in a Domain file, normally located in the ~/Library/Application Support/iWeb folder (although it can be moved). That's the file you need to transfer to your other Mac — not the published (HTML) files. See also NOTE 1 here:
    http://iwebfaq.org/site/iWebTwocomputers.html
    To open a site in iWeb, double-click its Domain file. See also this article:
    _How do you manage multiple domain files for iWeb?_

  • Defining the size of swing object which has overriden paint method

    Hi All!
    I have a text and I want to visualize it by my own. I use font type in the drawing which affects the painting size of the component. Before drawing I need to know the size of this component. because I want to handle mouseevents and other stuffs which need the bound size of this component. Therefore I have to set the bounds . But the size will be known at the drawing ... :(
    How can I define the exact size of this component before the drawing?
    eha

    Generally, you should override getMinimumSize() and getPreferredSize(), and let the layout manager set the size of your component. With this approach, you should be prepared for the case where your component is not given its minimum or preferred size, but some other size.
    To calculate the size that you require, you'll need to use a similar strategy to what's in your paint method. For example, you may need to calculate the width and height of your string (using the current font), within getMinimumSize() and getPreferredSize().

  • How to handle user preference which has "_" and " " in the name

    Hi Experts,
    I have a question how to handle value which has like "_" and "space" etc in user preference.
    If setting "a_b-c d", I could not retrieve this because it's escaped in database.
    So this code can't get value even though I can set it.
    Is there any restriction of name? Is there any documentation how to code user prefernece which has non alphabet and number in the name?
    I know it's possible to handle the data like adding escaped data. But I don't think this is the best way to retrieve the data. Because nobody confirm it's not problem in the future.
    Could you tell me the best way to get these user preference?
    Thanks in advance,
    Masaaki Tada
    Here is a sample.
    <%@ page contentType="text/html;charset=Shift_JIS" %><%@ page language="java" import="com.plumtree.remote.portlet.*, com.plumtree.remote.prc.*, java.util.*" %>
    <%
    /** * UserInfo - Simple Page * Display User Information*/
    // VariablesIPortletContext oPortletContext = null;IPortletRequest oPortletRequest = null;IPortletUser oPortletUser = null;IPortletResponse oPortletResponse = null;IRemoteSession s;IUserManager oUser;
    /* Get Portlet Objects */
    try{oPortletContext = PortletContextFactory.createPortletContext(request, response);oPortletRequest = oPortletContext.getRequest();oPortletUser = oPortletContext.getUser();oPortletResponse = oPortletContext.getResponse();} catch (Exception e) {oPortletContext = null;oPortletRequest = null;oPortletUser = null;oPortletResponse = null;}
    String val = oPortletRequest.getSettingValue( SettingType.User, "a_b-c d" );String hoe = oPortletRequest.getSettingValue( SettingType.User, "abcd" );out.println( "a_b-c d: " + val );out.println( "abcd : " + hoe );
    oPortletResponse.setSettingValue( SettingType.User, "a_b-c d", "aiueo" );oPortletResponse.setSettingValue( SettingType.User, "abcd", "bbbb" );%>

    Plumtree recommends that user preference names have only alphanumeric characters in them (a-z, A-Z, 0-9). Any non-alphanumeric characters will be encoded by the EDK.
    I strongly suggest that you change your user pref name to something that's alphanumeric. However, if that is not possible, you can use the following workaround: in the web service editor, enter the encoded name for the user pref. There are several ways to get the encoded name.
    One way is to encode the pref manually, yourself. Plumtree uses the %u encoded format: each non alphanumeric character is converted into %uxxxx, where xxxx is the Unicode representation of the character. For all ASCII characters, just look at the ASCII hex chart. For example, character "-" has a hex value of 2d. So, a preference name "jane_pref" would be encoded to "jane%u002dpref", and you'd enter the latter value on the preferences page in the web service editor.
    The other way to find out the encoded value is to set a preference programmatically and use the HTTP tunnel tool to look at HTTP traffic between the portal server and remote server. The remote server will be sending a HTTP header to the portal server (the header name will probably be CSP-User-Pref) and inside the header you should see the pref name, encoded with %u. Just copy it out of there and into the web service editor.
    Hope this helps,
    Jane

  • Jndi lookup of of object that has been bound remotely

    I want to register in weblogic server jndi tree some remote objects. A one standalone
    application binds these object in server jndi. Another standalone app try to lookup
    and executes some methods - everything works ok.
    The problem is : applications which works internally on server can't lookup these
    object. It's initial context doesn't contains such bindings. What's the difference
    between naming contexts
    inside and outside the server?
    Thank in advance,
    Vladimir.

    Hi JP3O,
    >> But that doesn't help because CurrentExcelWorksheetEventsInstance is not nothing even after all properties give errors. What is a better test or approach I can use?
    In my option, if you refer to the property of the Worksheet object which has been deleted, the error would be raised as expected. I think you could use the try catch statement to deal with this situation. Some key code like below:
    Dim oxl As Excel.Application
    Dim owb As Excel.Workbook
    Dim osheet As Excel.Worksheet
    Dim owbname As String
    oxl = New Excel.Application
    owb = oxl.Workbooks.Open("D:\Test\VSC#\03\Winform\VBWinform\Test.xlsx")
    osheet = owb.Worksheets("sheet1")
    Try
    osheet = owb.Worksheets.Add()
    owb.Close(False)
    owbname = owb.Name
    Catch comex As System.Runtime.InteropServices.COMException
    If comex.ErrorCode = -214682246 Or comex.Message.Contains("Object has been deleted") Then
    ' handle deleted object
    Else
    Throw comex
    End If
    End Try
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Is there an object which resembles Moving S, N, W, E in JAVA?

    I am trying to build a GUI which is supposed to use an object which
    has four arrows indicating moving a picture south, north, west, and north.
    Is there such an object available in java? I can not imagine that I
    have to create such thing myself. Thank you.

    would this fit ur need?
    have a jlabel inside a jscroll panel and hide the scroll bars and add buttons on the side to act as the scrollbars?
    so use like borderlayout and have the north button in the north part etc...then have the jscrollpanel in the middle which contains the jlabel which contains the image...
    im not making any sense?

  • Serialializing non serializable objects

    Hi guys,
    I have to serialize (and then send through socket) a class which implements java.io.Serializable. This class also has some reference with other classes, which should be serialized togheter.
    But when I run the main class (which only serializes) , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively serializable?
    How do I serialize too even with non-serializable objects?
    (I need all these objects)
    note : In the class I have only put the marker "implements java.io.Serializable",should I have to do somenthing else?
    Thank You for your great help!

    Hi guys,
    I have to serialize (and then send through socket)a
    class which implements java.io.Serializable. This
    class also has some reference with other classes,
    which should be serialized togheter.
    But when I run the main class (which onlyserializes)
    , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively
    serializable?
    How do I serialize too even with non-serializable
    objects?
    (I need all these objects)
    note : In the class I have only put the marker
    "implements java.io.Serializable",should I have todo
    somenthing else?
    Thank You for your great help!I wish there was a utility that could inspect a
    Class, traverse its containment tree and flag
    serializability issues. This could be more powerful
    if generics are used.
    To solve your problem besides the marker, implement
    methods writeObject and readObject and serializing
    the contained object that is not serializable by
    hand. For example if your class is X which contains Y
    that is not serializable then you need to serialize
    fields Y in X.writeObject and construct a Y object in
    X.readObject:
    class Y { // not serializable and you cannot modify
    it
    int i;
    int j;
    Y(int i, int j)
    class X implements Serializable {
    String xyz;
    Y y;
    private void writeObject(ObjectOutputStream out)
    throws IOException{
    out.writeObject(xyz);
    out.writeInt(y.getI());
    out.writeInt(y.getJ());
    private void readObject(ObjectInputStream in)
    throws IOException{
    xyz = (String) in.readObject();
    int i = in.readInt();
    int j = in.readInt();
    y = new Y(i, j);Remember to maintain the same order in readObject and
    writeObject.
    Hi guys,
    I have to serialize (and then send through socket)a
    class which implements java.io.Serializable. This
    class also has some reference with other classes,
    which should be serialized togheter.
    But when I run the main class (which onlyserializes)
    , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively
    serializable?
    How do I serialize too even with non-serializable
    objects?
    (I need all these objects)
    note : In the class I have only put the marker
    "implements java.io.Serializable",should I have todo
    somenthing else?
    Thank You for your great help!I wish there was a utility that could inspect a
    Class, traverse its containment tree and flag
    serializability issues. This could be more powerful
    if generics are used.
    To solve your problem besides the marker, implement
    methods writeObject and readObject and serializing
    the contained object that is not serializable by
    hand. For example if your class is X which contains Y
    that is not serializable then you need to serialize
    fields Y in X.writeObject and construct a Y object in
    X.readObject:
    class Y { // not serializable and you cannot modify
    it
    int i;
    int j;
    Y(int i, int j)
    class X implements Serializable {
    String xyz;
    Y y;
    private void writeObject(ObjectOutputStream out)
    throws IOException{
    out.writeObject(xyz);
    out.writeInt(y.getI());
    out.writeInt(y.getJ());
    private void readObject(ObjectInputStream in)
    throws IOException{
    xyz = (String) in.readObject();
    int i = in.readInt();
    int j = in.readInt();
    y = new Y(i, j);Remember to maintain the same order in readObject and
    writeObject.

  • Non Serializable Objects

    I am working on a java project and I have to serialize a class (created by me) which has many references to other classes that should be serialized too.
    I add the marker "implements serializable" to all the necessary classes, but when I run I get a non serializable exception.
    Maybe one ore more objects are non serializable, but how do I identify them?
    I've read that If I have to serialize non serializable objects, I need to write my own writeObject(ObjectOutputStream out)throws IOException and readObject(ObjectInputStream in) , but I don't know how to implement and us them.
    note : I can't use transient beacuse I need everything to be serialized!
    Thanks a lot. Bye!

    Now I'll post my code, If anyone knows how to serialize (and then deseserialize) the class "AgentMessage" , and its subclasses "StaticPart" and "DynElement" from the main class , I'll be grateful.. It's about 2 days I'm working on it and I continue getting "nonserialializable exception" ...
    thank you guys
    package agentsLibrary;
    //some imports
    public class AgentMessage implements Serializable{
         private static final long serialVersionUID = 1L;
         private StaticPart sp;
         private DynElement de;
         public AgentMessage(String agent,byte[] code,String mainclass,Certificate signerId,PrivateKey priv,String configuration,Serializable dclear,byte[] dsecret,PathEl[] dpath,byte[] c){ //costruttore
              sp=new StaticPart(agent,code,mainclass,signerId,priv,configuration);
              de=new DynElement(dclear,dsecret,c,dpath);
         public StaticPart getSp(){
              return sp;
         public DynElement getDe(){
              return de;
         private void writeObject(java.io.ObjectOutputStream out) throws IOException{
              System.out.println("class implements writeObject( )");
              //depends on the method to store out all the important state
              //out.defaultWriteObject();//perform the default serialization(va sempre fatto il default)
              out.writeObject(sp);
              out.writeObject(de);
         private void readObject(java.io.ObjectInputStream in)throws ClassNotFoundException, IOException {
              System.out.println("class implements readObject( )");
              //in.defaultReadObject();
              sp=(StaticPart)in.readObject();
              de=(DynElement)in.readObject();
    package agentsLibrary;
    public class StaticPart implements Serializable{
         private static final long serialVersionUID = 1L;
         private String agent="";
         private byte[] code=null;
         private String mainclass="";
         private Certificate signerid=null;
         private PrivateKey priv=null;
         private Calendar timestamp=null;
         private Signature sig=null;
         private byte[] buffertotale=null;
         private byte[] firma=null;
         private String configuration="";
         public StaticPart(String agent, byte[] code, String mainclass, Certificate signerid, PrivateKey priv,String configuration){
              this.configuration=configuration;
              this.code=code;
              this.mainclass=mainclass;
              this.agent=agent;
              this.priv=priv;
              this.signerid=signerid;
              timestamp=Calendar.getInstance();
              Date time=new Date();
              time=timestamp.getTime();//Gets this Calendar's current time.
              try {
                   byte[] nomeagent=agent.getBytes("8859_1");//converto stringa
                   byte[] mainclas=mainclass.getBytes("8859_1");//converto stringa
                   byte[] signer=signerid.getEncoded();
                   byte[] priva=priv.getEncoded();
                   byte[] dat=null;
                   dat=time.toString().getBytes("8859_1");
                   buffertotale=new byte[nomeagent.length+mainclas.length+signer.length+priva.length+dat.length+code.length];
                   System.arraycopy(nomeagent, 0, buffertotale, 0, nomeagent.length);
                   System.arraycopy(code, 0, buffertotale, nomeagent.length, code.length);
                   System.arraycopy(mainclas, 0, buffertotale, code.length, mainclas.length);
                   System.arraycopy(signer, 0, buffertotale, mainclas.length, signer.length);
                   System.arraycopy(priva, 0, buffertotale, signer.length, priva.length);
                   System.arraycopy(dat, 0, buffertotale, priva.length, dat.length);
              } catch (UnsupportedEncodingException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (CertificateEncodingException e) {
                   e.printStackTrace();
                   System.exit(1);
              try {
                   sig = Signature.getInstance(priv.getAlgorithm());
                   sig.initSign(priv);
                   sig.update(buffertotale, 0, buffertotale.length);
                   firma=sig.sign();
              } catch (SignatureException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (InvalidKeyException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
                   System.exit(1);
         public boolean verify() {
              try{
                   PublicKey pub=signerid.getPublicKey();
                   Signature sig = Signature.getInstance(pub.getAlgorithm());
                   sig.initVerify(pub);
                   sig.update(buffertotale, 0, buffertotale.length);
                   return sig.verify(firma);
              } catch (SignatureException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (InvalidKeyException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
                   System.exit(1);
              return false;
         public String getAgentName() {
              return agent;
         public byte[] getCode() {
              return code;
         public String getClassName() {
              return mainclass;
         public PrivateKey getPrivate() {
              return priv;
         public Certificate getId() {
              return signerid;
         public byte[] getSignature(){
              return firma;
         public String getConfiguration(){
              return configuration;
    package agentsLibrary;
    import java.io.Serializable;
    public class DynElement implements java.io.Serializable{
         private static final long serialVersionUID = 1L;
         private Serializable dclear=null;
         private byte[] dsecret=null;
         private PathEl[] dpath=null;
         private byte[]c=null;
         public DynElement(Serializable dclear,byte[] dsecret,byte[]c,PathEl[] dpath){
              this.dclear=dclear;
              this.dsecret=dsecret;
              this.c=c;
              this.dpath=dpath;
         public byte[] getC() {
              return c;
         public Serializable getDclear() {
              return dclear;
         public PathEl[] getDpath() {
              return dpath;
         public byte[] getDsecret() {
              return dsecret;
    //finally the following is the main class that should serialize
    AgentMessage msg=new AgentMessage(name,code,mainclass,signerId,privata,configuration,dclear,dsecret,dpath,c);
              try {
                   System.out.println("Sending Agent Message to Server "+ip+":"+port);
                   Socket s = new Socket(ip,port);
                   ObjectOutputStream out=new ObjectOutputStream(s.getOutputStream());
                   out.writeObject(msg);
                   out.flush();
                   s.close();
              } catch (Exception e) {
                   return false;
              return true;
         }

  • How to store a Non Serializable Java Object ?

    Hi..
    I have a non serializable java object which I want to store in the Oracle database and retrieve it. Can anyone help me with how to go about doing this ?
    many thanks in advance
    Ragavan

    If you share the same JVM then its possible, but I doubt that is the case. If you don't share the JVM then its
    impossible to share an object between two apps.
    But if all your attempting to do is duplicate the object in the other app then I spose it is possible, as long as
    you can reconstruct the object from information that you can interegate from the object.
    For example, if you have App A, and App B. WIthin App A is a Double d object. Then you could get the
    value of the Double by doing:
    d.doubleValue()
    write the double to a file/socket/stream, read the file/socket/stream at the other end, create a new Double
    via Double d = new Double(parsedValue);
    Now the two Apps will have a Double d object that represent the same value via a a.equals(b) == true, but
    they will not refer to the same object within memory/jvm.
    James.

  • Inserting non-serializable objects

    Is there any way to insert non-serializable objects into a database? (Or to convert them to bytes?)

    Is there any way to insert non-serializable objectsinto a database?
    A joke right?No, it's not a joke. It would be a pretty bad one if it were.
    Yes, there is a way. Create a table that corresponds
    to the object where each attribute in the object
    corresponds to field in the object. Add a unique key
    if one doesn't exist.I wish it were that simple. I don't have access to those attributes...
    >
    To create an object insert a row into the table. To
    load the object use the unique key to query for the
    row. To 'delete' the object delete the row from the
    table.BTW, the object in question is the java.awt.geom.Area object (http://java.sun.com/j2se/1.3/docs/api/java/awt/geom/Area.html ).
    The only way I can think of to insert an object that doesn't map to a SQL type is to convert it to bytes through serialization, and insert it as RAW data.
    I've extended Area to add a name and made my class serializable. However, since Area is not serializable, the only data I can retrieve after deserializing is the name I added (from my understanding of serialization, I have to save Area's data myself, but can't since I don't have access to it, so the deserialization process calls the Area() constructor which initializes the object to empty).

Maybe you are looking for

  • Can a check-box be used to select more than one value

    Hi, I have a form with a check-box that only allows one selection at a time. I have a requirement now to allow the user to select multiple selections. How can I accomplish this with a checkbox? Please help.

  • Changes to SAP BI master data reflecting in Crystal Filters

    Hello All We are looking at a scenario where Crystal Reports is used to report off SAP BI. One of the characteristics in BI is used as a filter in Crystal. If new master data value is added to this characteristic in BI, is it automatically reflected

  • Lumia 1020 SMS Issue.

    Been having issues for a few months now and haven't been able to find any solutions online. I'm having an issue where I can not send messages to certain numbers and I am just receiving the "Can't send" message as if I had no signal. What's even more

  • Array not printing  correctly from main to subreport

    Hi All,    I am using an array to print values from a main report to a subreport. Here's the array formula I use in the group footer of my main report: whileprintingrecords; stringvar strCalls; strCalls:=totext(Sum ({Group.Calls}, {Group.GroupNumber}

  • Header condition for Freight charges

    Gurus, What happens when i create the Freight charges as a header condition.Is it possible to work with planned delivery charges with header freight condition