| Summary: | NotSerializableException when using DistributedEventAdmin with remote services | ||
|---|---|---|---|
| Product: | [RT] ECF | Reporter: | Ajay <ajay.upadhyaya> |
| Component: | ecf.remoteserviceadmin | Assignee: | ecf.core-inbox <ecf.core-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | slewis |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Ajay
From the stack trace provided...i.e.
Caused by: java.io.NotSerializableException: Cannot serialize property value of
name=clientBundle.version and value=1.0.0.qualifier
at
org.eclipse.ecf.remoteservice.eventadmin.EventMessage.createPropertiesFromEvent(EventMessage.java:51)
at
org.eclipse.ecf.remoteservice.eventadmin.EventMessage.<init>(EventMessage.java:35)
at
org.eclipse.ecf.remoteservice.eventadmin.DistributedEventAdmin.createMessageDataFromEvent(DistributedEventAdmin.java:249)
at
org.eclipse.ecf.remoteservice.eventadmin.DistributedEventAdmin.sendMessage(DistributedEventAdmin.java:205)
...
it seems that the failure is in the serialization of one of your properties in the Event...specifically the property 'clientBundle.version'. First question: this is one of the properties you added to the event, isn't it? Something to note: Every one of the the event properties must be Serializable...so that the Event itself can be serialized and distributed (with the generic provider).
It seems likely to me that the value of this property (which is reported in the stack trace as value=1.0.0.qualifier) is actually of type org.osgi.framework.Version (gotten from Bundle.getVersion()?)...which is *not* Serializable. This fits with the error message: Cannot serialize property value of name=clientBundle.version and value=1.0.0.qualifier
If the value is converted from org.osgi.framework.Version to...e.g...a String...e.g. String bundleVersionValue = bundle.getVersion().toString();
then it then should be Serializable.
Resolving, as this seems to be problem with one of the event properties being not serializable rather than a problem with ECF distributed event admin. |