Home » Eclipse Projects » Eclipse Platform » Status, MultiStatus, CoreException not Serializable
Status, MultiStatus, CoreException not Serializable [message #137957] |
Tue, 30 September 2003 11:13  |
Eclipse User |
|
|
|
Hi,
I get the following exception when attempting to serialize (via
writeExternal) a subclass of CoreException on the 2.1.1 platform:
java.io.NotSerializableException: org.eclipse.core.runtime.Status
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
Is there a reason why Status and MultiStatus are not Serializable? Does
someone have a solution to this problem? The easiest solution that I can
think of is to have org.eclipse.core.runtime.IStatus extend
java.io.Serializable.
Thanks.
AD
|
|
| |
Re: Status, MultiStatus, CoreException not Serializable [message #138553 is a reply to message #138491] |
Wed, 01 October 2003 13:03   |
Eclipse User |
|
|
|
Michael,
Thanks for your reply. Please see my inline comments.
Basically, I'm looking for what you and the other folks on this newgroup
would think a good solution would look like.
"Michael Valenta" <Michael_Valenta@oti.com> wrote in message
news:3F7AF2C0.301@oti.com...
> Why are you trying to serialize instances of IStatus?
CoreException has a reference to IStatus. I'm trying to serialize an
exception that is a subclass of CoreException.
> These objects
> represent information about an exception that occurred. This information
> does not need to be (and probably shouldn't be) persisted or
> communicated remotely.
True, it probably need not be communicated independently, but I'm trying to
serialize the CoreException subclass, which in turn tries to serialize
Status, which fails.
> Even if you needed to do this for some reason,
We have integrated our server product with the eclipse *platform*.
CoreException has gone a long way in providing us a good deal of information
about exceptions in our server. For obvious reasons we would like to
communicate those exceptions to the client. This is where the utility of
CoreException breaks down.
I suspect that as the popularity of the platform grows, it will be used in a
variety of ways, and you will see more people with the same problem.
<soapBox>
1) The utility of the eclipse platform as a whole is limited by the types of
applications with/within which it can be deployed. It can be argued that I
dug my own grave by using it in the first place, but in keeping with the
philosophy of *platform* ubiquity, I believe that CoreException should be
serializable. Currently, by using IStatus CoreException limits itself to be
in a given VM, making it very difficult to share that information.
2) java.lang.Throwable implements java.io.Serializable, implying that all
exceptions are (or should be according to Serializable contract)
serializable, which is why I believe that CoreException has a bug.
</soapBox>
> my
> understanding is that object serialization is not the best way to
> persist or transmit object state.
You're right. However, I have to serialize something to get the failure
information across the network boundary. I could create a memento, but it
would also need to capture type information (which is important to me),
making it tedious to implement serialization/deserialization. Since, object
serialization in java handles most of that work for me, it provides me with
the *easiest* and quickest (to develop) alternative.
I obviously don't care about performance since this information is only
serialized in case an exception occurred.
>
> Michael
>
> Aditya Muralidharan wrote:
>
> > Hi,
> >
> > I get the following exception when attempting to serialize (via
> > writeExternal) a subclass of CoreException on the 2.1.1 platform:
> >
> > java.io.NotSerializableException: org.eclipse.core.runtime.Status
> > at java.io.ObjectOutputStream.outputObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
> > at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
> > at java.io.ObjectOutputStream.outputObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject(Unknown Source)
> >
> > Is there a reason why Status and MultiStatus are not Serializable? Does
> > someone have a solution to this problem? The easiest solution that I can
> > think of is to have org.eclipse.core.runtime.IStatus extend
> > java.io.Serializable.
> >
> > Thanks.
> >
> > AD
> >
> >
> >
>
|
|
|
Re: Status, MultiStatus, CoreException not Serializable [message #138962 is a reply to message #138553] |
Thu, 02 October 2003 10:46  |
Eclipse User |
|
|
|
Originally posted by: Michael_Valenta.oti.com
Well, if you feel strongly about it then you should log a feature
request against Platform Core.
Aditya Muralidharan wrote:
> Michael,
>
> Thanks for your reply. Please see my inline comments.
>
> Basically, I'm looking for what you and the other folks on this newgroup
> would think a good solution would look like.
>
> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
> news:3F7AF2C0.301@oti.com...
>
>>Why are you trying to serialize instances of IStatus?
>>
>
> CoreException has a reference to IStatus. I'm trying to serialize an
> exception that is a subclass of CoreException.
>
>
>
>>These objects
>>represent information about an exception that occurred. This information
>>does not need to be (and probably shouldn't be) persisted or
>>communicated remotely.
>>
>
> True, it probably need not be communicated independently, but I'm trying to
> serialize the CoreException subclass, which in turn tries to serialize
> Status, which fails.
>
>
>
>
>>Even if you needed to do this for some reason,
>>
>
> We have integrated our server product with the eclipse *platform*.
> CoreException has gone a long way in providing us a good deal of information
> about exceptions in our server. For obvious reasons we would like to
> communicate those exceptions to the client. This is where the utility of
> CoreException breaks down.
>
> I suspect that as the popularity of the platform grows, it will be used in a
> variety of ways, and you will see more people with the same problem.
>
> <soapBox>
> 1) The utility of the eclipse platform as a whole is limited by the types of
> applications with/within which it can be deployed. It can be argued that I
> dug my own grave by using it in the first place, but in keeping with the
> philosophy of *platform* ubiquity, I believe that CoreException should be
> serializable. Currently, by using IStatus CoreException limits itself to be
> in a given VM, making it very difficult to share that information.
>
> 2) java.lang.Throwable implements java.io.Serializable, implying that all
> exceptions are (or should be according to Serializable contract)
> serializable, which is why I believe that CoreException has a bug.
> </soapBox>
>
>
>>my
>>understanding is that object serialization is not the best way to
>>persist or transmit object state.
>>
>
>
> You're right. However, I have to serialize something to get the failure
> information across the network boundary. I could create a memento, but it
> would also need to capture type information (which is important to me),
> making it tedious to implement serialization/deserialization. Since, object
> serialization in java handles most of that work for me, it provides me with
> the *easiest* and quickest (to develop) alternative.
>
> I obviously don't care about performance since this information is only
> serialized in case an exception occurred.
>
>
>
>>Michael
>>
>>Aditya Muralidharan wrote:
>>
>>
>>>Hi,
>>>
>>>I get the following exception when attempting to serialize (via
>>>writeExternal) a subclass of CoreException on the 2.1.1 platform:
>>>
>>>java.io.NotSerializableException: org.eclipse.core.runtime.Status
>>> at java.io.ObjectOutputStream.outputObject(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>> at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
>>> at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
>>> at java.io.ObjectOutputStream.outputObject(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>
>>>Is there a reason why Status and MultiStatus are not Serializable? Does
>>>someone have a solution to this problem? The easiest solution that I can
>>>think of is to have org.eclipse.core.runtime.IStatus extend
>>>java.io.Serializable.
>>>
>>>Thanks.
>>>
>>>AD
>>>
>>>
>>>
>>>
>
>
|
|
|
Goto Forum:
Current Time: Tue Jul 15 11:54:40 EDT 2025
Powered by FUDForum. Page generated in 0.04471 seconds
|