[ 
http://issues.apache.org/jira/browse/TUSCANY-130?page=comments#action_12371637 
] 

James M Snell commented on TUSCANY-130:
---------------------------------------

Yeah, the problem is that we forgot to implement the 
create/convertXXXFromString() methods in ModelFactoryImpl.  I'll take a look at 
this on Monday of next week (Mar28).

> IllegalArgumentException is thrown when XMLHelper loads the XML document with 
> string value for xsd:anySimpleType
> ----------------------------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-130
>          URL: http://issues.apache.org/jira/browse/TUSCANY-130
>      Project: Tuscany
>         Type: Bug
>   Components: Java SDO Implementation
>     Reporter: Raymond Feng

>
> Here's the stack trace:
> Thread [main] (Suspended (exception IllegalArgumentException))
>       ModelFactoryImpl(EFactoryImpl).createFromString(EDataType, String) 
> line: 419
>       ModelFactoryImpl.createObjectFromString(EDataType, String) line: 817
>       ModelFactoryImpl.createFromString(EDataType, String) line: 154
>       XMLHelperImpl.createFromString(EFactory, EDataType, String) line: 1421
>       XMLHelperImpl.setValue(EObject, EStructuralFeature, Object, int) line: 
> 953
>       SAXXMLHandler(XMLHandler).setFeatureValue(EObject, EStructuralFeature, 
> Object, int) line: 2329
>       SAXXMLHandler(XMLHandler).setAttribValue(EObject, String, String) line: 
> 2387
>       SAXXMLHandler.handleObjectAttribs(EObject) line: 72
>       SAXXMLHandler(XMLHandler).createObject(EFactory, EClassifier, boolean) 
> line: 1924
>       SAXXMLHandler(XMLHandler).createObjectFromFeatureType(EObject, 
> EStructuralFeature) line: 1832
>       SAXXMLHandler(XMLHandler).createObject(EObject, EStructuralFeature) 
> line: 1724
>       SAXXMLHandler(XMLHandler).handleFeature(String, String) line: 1510
>       SAXXMLHandler(XMLHandler).processElement(String, String, String) line: 
> 838
>       SAXXMLHandler(XMLHandler).startElement(String, String, String) line: 816
>       SAXXMLHandler(XMLHandler).startElement(String, String, String, 
> Attributes) line: 588
>       SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName, 
> XMLAttributes, Augmentations) line: not available
>       XMLNSDocumentScannerImpl.scanStartElement() line: not available
>       
> XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean)
>  line: not available
>       
> XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean)
>  line: not available
>       XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) 
> line: not available
>       
> XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) 
> line: not available
>       SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: not 
> available
>       SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource) line: 
> not available
>       SAXParserImpl.parse(InputSource, DefaultHandler) line: not available
>       XMLLoadImpl.load(XMLResource, InputSource, Map) line: 262
>       XMLResourceImpl.doLoad(InputSource, Map) line: 658
>       XMLResourceImpl.load(InputSource, Map) line: 626
>       XMLDocumentImpl.load(InputSource, String, Object) line: 246
>       XMLDocumentImpl.load(InputStream, String, Object) line: 225
>       XMLHelperImpl.load(InputStream, String, Object) line: 72
>       XMLHelperImpl.load(InputStream) line: 66
>       DataObjectStAXWrapper.loadSlow(OMElement, TypeHelper) line: 174
>       DataObjectStAXWrapper.load(OMElement, TypeHelper, boolean) line: 158
>       DataObjectStAXWrapperTestCase.roundTrip(DataObject, String, String, 
> TypeHelper, boolean) line: 79
>       DataObjectStAXWrapperTestCase.testPerformance() line: 191
>       NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
> available [native method]
>       NativeMethodAccessorImpl.invoke(Object, Object[]) line: 64
>       DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
>       Method.invoke(Object, Object...) line: 615
>       DataObjectStAXWrapperTestCase(TestCase).runTest() line: 154
>       DataObjectStAXWrapperTestCase(TestCase).runBare() line: 127
>       TestResult$1.protect() line: 106
>       TestResult.runProtected(Test, Protectable) line: 124
>       TestResult.run(TestCase) line: 109
>       DataObjectStAXWrapperTestCase(TestCase).run(TestResult) line: 118
>       TestSuite.runTest(Test, TestResult) line: 208
>       TestSuite.run(TestResult) line: 203
>       RemoteTestRunner.runTests(String[], String) line: 478
>       RemoteTestRunner.run() line: 344
>       RemoteTestRunner.main(String[]) line: 196
> For the given XSD:
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema";
>       targetNamespace="http://complex"; xmlns:tns="http://complex";>
>       <element name="order" type="tns:Order"/>
>       <element name="item" type="tns:Item"/>
>       
>       <element name="comment1" type="string"/>
>       <element name="comment2" type="tns:ComplexComment"/>
>       <element name="comment3" type="anyType"/>
>       <attribute name="comment4" type="anySimpleType"/>
>       <complexType name="Order">
>               <sequence>
>                       <element name="orderId" type="string"/>
>                       <element name="item" type="tns:Item" 
> maxOccurs="unbounded"></element>
>                       <element name="comments" type="tns:Comments"></element>
>               </sequence>
>       </complexType>
>       <complexType name="Comments">
>               <sequence>
>                       <any/>
>               </sequence>
>               <anyAttribute/>
>       </complexType>
>       <complexType name="ComplexComment">
>               <sequence>
>                       <element name="user" type="string"/>
>                       <element name="comment" type="string"/>
>               </sequence>
>       </complexType>
>       
>       <complexType name="Item">
>               <sequence>
>                       <element name="lineNo" type="string"/>
>                       <element name="name" type="string"/>
>                       <element name="quantity" type="int"/>
>               </sequence>
>       </complexType>
> </schema>
> The anySimpleType is mapped to a DataType with instance class of 
> java.lang.Object. And the EcoreUtil.createFromString() cannot handle the 
> creation of java.lang.Object from a string value.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to