[
https://issues.apache.org/jira/browse/TUSCANY-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fuhwei Lwo updated TUSCANY-1131:
--------------------------------
Attachment: tuscany-1131.patch
I attached this file, tuscany-1131.patch, to try to fix this problem. Please
review.
> XMLHelper.save() throws exception when the serialized dataobject is not the
> root object and its container is of AnyTypeDataObject
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-1131
> URL: https://issues.apache.org/jira/browse/TUSCANY-1131
> Project: Tuscany
> Issue Type: Bug
> Affects Versions: Java-SDO-M3
> Reporter: Fuhwei Lwo
> Fix For: Java-SDO-M3
>
> Attachments: quoteInSOAP.xml, tuscany-1131-testcase.patch,
> tuscany-1131.patch
>
>
> To reproduce this problem, I modified the existing quote.xml content to be
> contained by SOAP elements that don't have XSD registered with SDO runtime so
> the container of stockQuote will be of AnyTypeDataObject. Below is the XML
> content. When I invoked XMLHelper.save() on stockQuote data object, I got
> the following exception. I assume this scenario should be supported.
> java.lang.ClassCastException:
> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl incompatible with
> java.util.Collection
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.set(BasicFeatureMap.java:1026)
> at
> org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureFeatureMap.set(FeatureMapUtil.java:1093)
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenSet(BasicEObjectImpl.java:723)
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:658)
> at
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(XMLDocumentImpl.java:205)
> at
> org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java:115)
> at
> org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java:110)
> at
> org.apache.tuscany.sdo.test.XMLHelperTestCase.testAnyTypeContainer(XMLHelperTestCase.java:175)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> <?xml version="1.0" encoding="ASCII"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:simple="http://www.example.com/simple">
> <soapenv:Header/>
> <soapenv:Body>
> <simple:stockQuote>
> <symbol>fbnt</symbol>
> <companyName>FlyByNightTechnology</companyName>
> <price>1000.0</price>
> <open1>1000.0</open1>
> <high>1000.0</high>
> <low>1000.0</low>
> <volume>1000.0</volume>
> <change1>1000.0</change1>
> <quotes>
> <price>2000.0</price>
> </quotes>
> </simple:stockQuote>
> </soapenv:Body>
> </soapenv:Envelope>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]