I'm trying to add some support for business objects to the Tutorial (instead of just flowing the catalog and cart items as strings).

My business objects are simple JavaBeans with an empty constructor. I need to flow them as Java objects through local service calls, XML (in Atom payloads) and JSON.

It should have been a simple exercise, but I've been running into a number of issues with the DataBinding framework. Here they are:

1. Some of the Bean2* and *2Bean transformers were missing to META-INF/services I added them.

2. The Databinding framework was not finding the transformers in XML <-> registrations. I changed all instances of java.lang.String to xml.string in the registrations of the *2String and String2* transformer to fix that.

3. Next I ran into a ClassCastException in XML2JavaBeanTransformer at
public Object transform(T source, TransformationContext context) {
- -> XMLType xmlType = (XMLType) context.getSourceDataType().getLogical();
as the logical type was Class instead of XMLType

4. I had to add "implements Serializable" to my business object class as it looks like we are using Java serialization to enforce pass by value in local service calls. I don't think it's right as we are not using Java serialization to pass the same business object through a remote call. We should change to use the same XML transformation to enforce pass by value with local calls as well, and not require the business objects to be Serializable.

5. After changes (1), (2), (3) and (4) I am now running into a build issue:
testTransform1(org.apache.tuscany.sca.databinding.impl.MediatorImplTestCase) Time elapsed: 0.02 sec <<< ERROR! java.lang.ClassCastException: org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer cannot be cast to org.apache.tuscany.sca.databinding.DataPipeTransformer at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:75) at org.apache.tuscany.sca.databinding.impl.MediatorImplTestCase.testTransform1(MediatorImplTestCase.java:104)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at junit.framework.TestCase.runTest(TestCase.java:168)
       at junit.framework.TestCase.runBare(TestCase.java:134)
       at junit.framework.TestResult$1.protect(TestResult.java:110)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.framework.TestResult.run(TestResult.java:113)
       at junit.framework.TestCase.run(TestCase.java:124)
       at junit.framework.TestSuite.runTest(TestSuite.java:232)
       at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:299) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:837)

I'm getting to the end of the rope here... does anyone know what can cause error (5)?

Thanks

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to