You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Scott Kurz (JIRA)" <de...@tuscany.apache.org> on 2011/08/03 17:08:27 UTC

[jira] [Created] (TUSCANY-3911) ServiceReference type not marshalled to XML correctly

ServiceReference type not marshalled to XML correctly
-----------------------------------------------------

                 Key: TUSCANY-3911
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3911
             Project: Tuscany
          Issue Type: Bug
          Components: SCA Java Runtime
    Affects Versions: Java-SCA-2.0
            Reporter: Scott Kurz
            Priority: Minor


When using a binding with an XML wireformat, the ServiceReference type is going to be treated as a JAXB by the Tuscany databinding framework, and is not going to get serialized correctly.

E.g. see this intf from the itest/service-reference module:

@Remotable
public interface DComponent {
    String foo(ServiceReference<AComponent> aReference); 

It works fine when we use a binding.sca config that does Java serialization, but if we try to use an XML wireformat we get the JAXB error:
  org.oasisopen.sca.ServiceReference is an interface, and JAXB can't handle interfaces.

I'm guessing the solution is to use JAXBs customizations/annotations to tell JAXB how to handle our ServiceReference impl.    But I'd have to look into that.

I guess there's also the idea of defining a new databinding but that seems odd.

Will attach a recreate patch.







--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TUSCANY-3911) ServiceReference type not marshalled to XML correctly

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-3911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Kurz updated TUSCANY-3911:
--------------------------------

    Attachment: 3911.recreate.patch

Assuming you have my recent binding.sca changes (r1153291), simply apply this small tweak to binding-sca-runtime

> ServiceReference type not marshalled to XML correctly
> -----------------------------------------------------
>
>                 Key: TUSCANY-3911
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3911
>             Project: Tuscany
>          Issue Type: Bug
>          Components: SCA Java Runtime
>    Affects Versions: Java-SCA-2.0
>            Reporter: Scott Kurz
>            Priority: Minor
>         Attachments: 3911.recreate.patch
>
>
> When using a binding with an XML wireformat, the ServiceReference type is going to be treated as a JAXB by the Tuscany databinding framework, and is not going to get serialized correctly.
> E.g. see this intf from the itest/service-reference module:
> @Remotable
> public interface DComponent {
>     String foo(ServiceReference<AComponent> aReference); 
> It works fine when we use a binding.sca config that does Java serialization, but if we try to use an XML wireformat we get the JAXB error:
>   org.oasisopen.sca.ServiceReference is an interface, and JAXB can't handle interfaces.
> I'm guessing the solution is to use JAXBs customizations/annotations to tell JAXB how to handle our ServiceReference impl.    But I'd have to look into that.
> I guess there's also the idea of defining a new databinding but that seems odd.
> Will attach a recreate patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TUSCANY-3911) ServiceReference type not marshalled to XML correctly

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

ant elder updated TUSCANY-3911:
-------------------------------

    Fix Version/s: Java-SCA-2.0

> ServiceReference type not marshalled to XML correctly
> -----------------------------------------------------
>
>                 Key: TUSCANY-3911
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3911
>             Project: Tuscany
>          Issue Type: Bug
>          Components: SCA Java Runtime
>    Affects Versions: Java-SCA-2.0
>            Reporter: Scott Kurz
>            Priority: Minor
>             Fix For: Java-SCA-2.0
>
>         Attachments: 3911.recreate.patch
>
>
> When using a binding with an XML wireformat, the ServiceReference type is going to be treated as a JAXB by the Tuscany databinding framework, and is not going to get serialized correctly.
> E.g. see this intf from the itest/service-reference module:
> @Remotable
> public interface DComponent {
>     String foo(ServiceReference<AComponent> aReference); 
> It works fine when we use a binding.sca config that does Java serialization, but if we try to use an XML wireformat we get the JAXB error:
>   org.oasisopen.sca.ServiceReference is an interface, and JAXB can't handle interfaces.
> I'm guessing the solution is to use JAXBs customizations/annotations to tell JAXB how to handle our ServiceReference impl.    But I'd have to look into that.
> I guess there's also the idea of defining a new databinding but that seems odd.
> Will attach a recreate patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TUSCANY-3911) ServiceReference type not marshalled to XML correctly

Posted by "Simon Nash (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-3911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078944#comment-13078944 ] 

Simon Nash commented on TUSCANY-3911:
-------------------------------------

JAXB provides the @XmlJavaTypeAdapter annotation to do custom marshalling and unmarshalling. The marshalling side is easy (for example, an adapter could convert a ServiceReferenceImpl to a String containg the XML representation), but it might be harder to persuade the JAXB unmarshaller to do the right thing with the XML element that it reads from the wire. There's a example in [1] that may provide some useful pointers, though it seems like quite a complex approach.

[1] http://stackoverflow.com/questions/512337/custom-serialization-in-jaxb

> ServiceReference type not marshalled to XML correctly
> -----------------------------------------------------
>
>                 Key: TUSCANY-3911
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3911
>             Project: Tuscany
>          Issue Type: Bug
>          Components: SCA Java Runtime
>    Affects Versions: Java-SCA-2.0
>            Reporter: Scott Kurz
>            Priority: Minor
>         Attachments: 3911.recreate.patch
>
>
> When using a binding with an XML wireformat, the ServiceReference type is going to be treated as a JAXB by the Tuscany databinding framework, and is not going to get serialized correctly.
> E.g. see this intf from the itest/service-reference module:
> @Remotable
> public interface DComponent {
>     String foo(ServiceReference<AComponent> aReference); 
> It works fine when we use a binding.sca config that does Java serialization, but if we try to use an XML wireformat we get the JAXB error:
>   org.oasisopen.sca.ServiceReference is an interface, and JAXB can't handle interfaces.
> I'm guessing the solution is to use JAXBs customizations/annotations to tell JAXB how to handle our ServiceReference impl.    But I'd have to look into that.
> I guess there's also the idea of defining a new databinding but that seems odd.
> Will attach a recreate patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira