You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Jonathan Giddy <jo...@gmail.com> on 2010/10/06 17:52:15 UTC

SDO and JSON-RPC circular references

We are attempting to create an SCA service that returns SDO objects to
a JSONRPC binding. We get the same "circular references" error as in
this 2007 email:
http://mail-archives.apache.org/mod_mbox/tuscany-dev/200706.mbox/%3Cc0c051b50706010341x76d88b4aye521ccc933af21a0@mail.gmail.com%3E

A solution is proposed in
http://mail-archives.apache.org/mod_mbox/tuscany-dev/200706.mbox/%3C4660AF6D.9050308@apache.org%3E
- the URL in this email has moved to
http://svn.apache.org/repos/asf/tuscany/sandbox/old/contrib/

The JSON data binding and XSDStream2JSON transformer code from this
directory now appear to be in the correct place in the SCA code:
http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/

However, we still get the "circular references" error, as though the
code was not there.

The PullTransformer metadata file contains the registrations for these
conversions:
http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer

However, most of the registration lines in this file include the
clause "public=false". Does this affect the visibility of the
transformations in the databinding graph? Could this be the reason for
the error message we are getting?

Is it possible to use SDO and JSONRPC together?

Thanks,
Jon.

Re: SDO and JSON-RPC circular references

Posted by Jonathan Giddy <jo...@gmail.com>.
On 6 October 2010 17:30, Raymond Feng <en...@gmail.com> wrote:
> Hi,
> A few pointers:
> 1) Can you try Tuscany 2.x? We have the databinding-json module
> at https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/databinding-json/.
> We now use jackson as the underlying stack to handle JSON. I'm not very sure
> if it can deal with circular dependency.
> 2) public=false means the transformer cannot be used as the intermediate hop
> as it cannot support full round-trip of the data transformation.

Thanks for the advice.

1) We tried to the upgrade to 2.0 by trivially changing 1.6 to 2.0-M5
in our POM file, but hit a problem. We will look at that option in
more detail later when we have time.

In the meantime, we have worked around the problem by implementing a
JAXB proxy component that accesses the SDO service and provides the
JSON service (similar to the ubiquitous data binding example from
Chapter 9 on Tuscany SCA in Action).

2) OK, so that means the transformation would be attempting to use the
configuration:

org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=commonj.sdo.DataObject,target=JSON,weight=80000,public=false

rather than the "shorter" path:

org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader;source=commonj.sdo.DataObject,target=javax.xml.stream.XMLStreamReader,weight=490

org.apache.tuscany.sca.databinding.json.XMLStreamReader2JSON;source=javax.xml.stream.XMLStreamReader,target=JSON,weight=5000,public=false

Is there any way to view the databinding graph?

Jon.

Re: SDO and JSON-RPC circular references

Posted by Raymond Feng <en...@gmail.com>.
Hi,

A few pointers:

1) Can you try Tuscany 2.x? We have the databinding-json module at https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/databinding-json/. We now use jackson as the underlying stack to handle JSON. I'm not very sure if it can deal with circular dependency. 

2) public=false means the transformer cannot be used as the intermediate hop as it cannot support full round-trip of the data transformation.  

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Oct 6, 2010, at 8:52 AM, Jonathan Giddy wrote:

> We are attempting to create an SCA service that returns SDO objects to
> a JSONRPC binding. We get the same "circular references" error as in
> this 2007 email:
> http://mail-archives.apache.org/mod_mbox/tuscany-dev/200706.mbox/%3Cc0c051b50706010341x76d88b4aye521ccc933af21a0@mail.gmail.com%3E
> 
> A solution is proposed in
> http://mail-archives.apache.org/mod_mbox/tuscany-dev/200706.mbox/%3C4660AF6D.9050308@apache.org%3E
> - the URL in this email has moved to
> http://svn.apache.org/repos/asf/tuscany/sandbox/old/contrib/
> 
> The JSON data binding and XSDStream2JSON transformer code from this
> directory now appear to be in the correct place in the SCA code:
> http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/
> 
> However, we still get the "circular references" error, as though the
> code was not there.
> 
> The PullTransformer metadata file contains the registrations for these
> conversions:
> http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
> 
> However, most of the registration lines in this file include the
> clause "public=false". Does this affect the visibility of the
> transformations in the databinding graph? Could this be the reason for
> the error message we are getting?
> 
> Is it possible to use SDO and JSONRPC together?
> 
> Thanks,
> Jon.