Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1103638

Summary: SW Graph Serialization (HTTPInvoker) does not serialize attributes of custom Exception
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: vkasala
Component: SwitchYardAssignee: Rob Cernich <rcernich>
Status: CLOSED UPSTREAM QA Contact: Matej Melko <mmelko>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: dward, rcernich, soa-p-jira, tasato
Target Milestone: DR2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:35:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Simple showcase of Graph serialization. none

Description vkasala 2014-06-02 09:06:55 UTC
Created attachment 901386 [details]
Simple showcase of Graph serialization.

Description of problem:

Switchyard internal Graph serialization cannot serialize attributes of custom exception inherited from the Exception class and thus HTTPInvoker (RemoteInvoker) is not also able to serialize attributes of our own custom Exception and propagate thrown Exception correctly to client.
Component: switchyard-serial

Version-Release number of selected component (if applicable):
1.1.1-p5-redhat-1

How reproducible:


Steps to Reproduce:
1. Create new custom Exception inherited from Exception.
2. Add new attributes + getters/setters.
3. Create serializer as in HTTPInvoker class :  "SerializerFactory.create(FormatType.JSON, null, true);"
4. Try to serialize and then deserialize your custom exception.
 

Actual results:
No attributes are serialized/deserialized correctly.

Expected results:
Attributes should be also serialized/deserialized correctly.

Comment 1 David Ward 2014-06-02 17:26:48 UTC
Keith and I looked at this last week. There is logic within the serialization code that specifically handles Throwables. Custom Exceptions are only supported if they contain a zero or one-arg constructor, but beyond that, any custom attributes (setters/getters/fields) will be ignored. So, the custom Exception will be re-constituted on the other side, but those extra attributes will be null.  This is because the serialization logic handles Throwables in a specific fashion, before - and instead of - our bean-handling serialization logic (specifically, our AccessNode logic).

If this issue gets a fix target, than it should be a relatively straightforward fix.

Comment 2 David Ward 2014-06-02 17:32:48 UTC
Created linked jboss jira: https://issues.jboss.org/browse/SWITCHYARD-2166

Comment 3 David Ward 2014-06-10 20:09:40 UTC
Pull requests are on the associate jira. I will copy/paste the link + comment here:

https://github.com/jboss-switchyard/core/pull/637

Throwables can now have custom attributes that will get ser/deserialized, OOTB. By default, though, they have to either have a no-arg or one-arg (String) constructor. If they don't, then using SwitchYard-specific annotations will have to be employed, using @Strategy(factory=MyCustomFactory.class). In the past, those annotations were ignored for Throwables.

Comment 8 Red Hat Bugzilla 2025-02-10 03:35:59 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.