You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Hasan Muhammad (JIRA)" <tu...@ws.apache.org> on 2007/01/31 20:34:05 UTC

[jira] Created: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Java Serialization: The Type definition is overwritten in the registry within the same scope
--------------------------------------------------------------------------------------------

                 Key: TUSCANY-1084
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-M2
         Environment: All
            Reporter: Hasan Muhammad
             Fix For: Java-M2


When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).

During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 

There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.

Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469188 ] 

Frank Budinsky commented on TUSCANY-1084:
-----------------------------------------

It seems like the problem is because you're passing the metadata in the DataGraph - i.e., you called SDOUtil.registerDataGraphTypes(). If you don't do that, does it work? If you pass the metadata, it would seem that you are asking it to replace it with the new version.

Frank.

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Closed: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder closed TUSCANY-1084.
------------------------------

    Resolution: Fixed

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-SDO-Mx
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amita Vadhavkar updated TUSCANY-1084:
-------------------------------------

    Fix Version/s:     (was: Java-SDO-Next)
                   Java-SDO-1.1

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-SDO-1.1
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder updated TUSCANY-1084:
-------------------------------

    Fix Version/s:     (was: Java-M2)
                   Java-SDO-Mx

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-SDO-Mx
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Hasan Muhammad (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469196 ] 

Hasan Muhammad commented on TUSCANY-1084:
-----------------------------------------

Yup.. That was it. I commented it out and it works now. So what about the second issue ? Is there a way to define a scope if we do serialization/deserialization through Output and InputStreams ?

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Hasan Muhammad (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469424 ] 

Hasan Muhammad commented on TUSCANY-1084:
-----------------------------------------

Ok. Opened Tuscany-1086 for this limitation. Will close this one

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Hasan Muhammad (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hasan Muhammad updated TUSCANY-1084:
------------------------------------

    Attachment: JavaSerializeDeserializeTestCase.java

I have attached a JUnit test case which basically creates the DataObject dynamically and then serializes it to a temp file. Then the DataObject is retrieved during the deserialization and the types of the two objects are compared resulting in the error.

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1084) Java Serialization: The Type definition is overwritten in the registry within the same scope

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469197 ] 

Frank Budinsky commented on TUSCANY-1084:
-----------------------------------------

Re: the point about serialization/deserialization only working in the global/default scope. That's a current limitation. I guess you should open a JIRA for it.

Maybe you want to implement it and also provide a patch? It's simply a matter of adding an SDOUtil.createObjectInputStream(HelperContext) method that returns a stream that also stores the context that was provided Then ResolvableImpl.readDataObject() should be changed to use the XMLHelper from that streams context, instead of the default one. The test program would be changed to get the input stream from the new SDOUtil method.

Frank.

> Java Serialization: The Type definition is overwritten in the registry within the same scope
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1084
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1084
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: JavaSerializeDeserializeTestCase.java
>
>
> When a DataObject is serialized using the java serialization ( ObjectOutputStream.writeObject) and deserialized back using ObjectInputStream.readObject, the types of the two dataobjects do not match, even though this all in the same scope ( global in this case ).
> During deserialization, it seems that the type of the dataobject cannot be found, and it is creating the type again and simply overwrites the previously registered type. This results in the dataobjects getting different types and the test case fails. 
> There is another issue here, which is that currently there seems to be no way to provide a scope when using these java serialization methods. For instance, when using XMLHelper, you can get a scope defined XMLHelper. But how do you do this when you are using the java serialization methods ? If you want me to open another Jira for this i will.
> Hasan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org