[jira] Updated: (TUSCANY-1812) XMLHelper.load() IOException using schema that has both a substitution group and an extension
[ https://issues.apache.org/jira/browse/TUSCANY-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Amita Vadhavkar updated TUSCANY-1812: - Fix Version/s: (was: Java-SDO-Next) Java-SDO-1.1 XMLHelper.load() IOException using schema that has both a substitution group and an extension - Key: TUSCANY-1812 URL: https://issues.apache.org/jira/browse/TUSCANY-1812 Project: Tuscany Issue Type: Bug Components: Java SDO Implementation Affects Versions: Java-SDO-Next Reporter: Ron Gavlin Priority: Critical Fix For: Java-SDO-1.1 Attachments: tuscany-sdo.TUSCANY-1812_1830_1832.patch Below, please find a failing Java test case and its XSD and XML test resources. Also, please find the stacktrace from the failing Java test case. It is interesting to note that this test does not fail when using dynamic SDO. Please comment if you have questions. - Ron package org.apache.tuscany.sdo.test; import java.io.IOException; import junit.framework.TestCase; import com.example.substitution.ev.SEVFactory; import commonj.sdo.DataObject; import commonj.sdo.helper.HelperContext; import commonj.sdo.helper.XMLHelper; import commonj.sdo.impl.HelperProvider; public final class SubstitutionWithExtensionValuesTestCase extends TestCase { public void test() throws IOException { HelperContext hc = HelperProvider.getDefaultContext(); SEVFactory.INSTANCE.register(hc); XMLHelper xmlHelper = hc.getXMLHelper(); DataObject loadedObject = xmlHelper.load(getClass().getResourceAsStream(/substitutionWithExtensionValues1.xml)).getRootObject(); } } substitutionWithExtensionValues.xsd schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://www.example.com/substitutionEV; xmlns:sv=http://www.example.com/substitutionEV; !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- element name=results type=sv:ResultsType/ element name=result type=sv:ResultType/ element name=myResult type=sv:MyResultType substitutionGroup=sv:result/ complexType name=ResultsType sequence element ref=sv:result minOccurs=0 maxOccurs=unbounded/ element name=comment type=string/ /sequence /complexType complexType name=ResultType sequence element name=name type=string/ element name=value type=string/ /sequence /complexType complexType name=MyResultType complexContent extension base=sv:ResultType/ /complexContent /complexType /schema substitutionWithExtensionValues1.xml ?xml version=1.0 encoding=ASCII? sev:results xmlns:sev=http://www.example.com/substitutionEV; sev:result sev:namename1/sev:name sev:valuevalue1/sev:value /sev:result sev:myResult sev:namemyName1/sev:name sev:valuemyValue1/sev:value /sev:myResult sev:commentcomment1/sev:comment /sev:results STACKTRACE org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'myResult' not found. (http:///temp.xml, 7, 17) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:278) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:666) at org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl.doLoad(SDOXMLResourceImpl.java:585) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:634) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:266) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:239) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:97) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:79) at
[jira] Updated: (TUSCANY-1812) XMLHelper.load() IOException using schema that has both a substitution group and an extension
[ https://issues.apache.org/jira/browse/TUSCANY-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ron Gavlin updated TUSCANY-1812: Patch Info: [Patch Available] XMLHelper.load() IOException using schema that has both a substitution group and an extension - Key: TUSCANY-1812 URL: https://issues.apache.org/jira/browse/TUSCANY-1812 Project: Tuscany Issue Type: Bug Components: Java SDO Implementation Affects Versions: Java-SDO-Next Reporter: Ron Gavlin Priority: Critical Fix For: Java-SDO-Next Attachments: tuscany-sdo.TUSCANY-1812_1830_1832.patch Below, please find a failing Java test case and its XSD and XML test resources. Also, please find the stacktrace from the failing Java test case. It is interesting to note that this test does not fail when using dynamic SDO. Please comment if you have questions. - Ron package org.apache.tuscany.sdo.test; import java.io.IOException; import junit.framework.TestCase; import com.example.substitution.ev.SEVFactory; import commonj.sdo.DataObject; import commonj.sdo.helper.HelperContext; import commonj.sdo.helper.XMLHelper; import commonj.sdo.impl.HelperProvider; public final class SubstitutionWithExtensionValuesTestCase extends TestCase { public void test() throws IOException { HelperContext hc = HelperProvider.getDefaultContext(); SEVFactory.INSTANCE.register(hc); XMLHelper xmlHelper = hc.getXMLHelper(); DataObject loadedObject = xmlHelper.load(getClass().getResourceAsStream(/substitutionWithExtensionValues1.xml)).getRootObject(); } } substitutionWithExtensionValues.xsd schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://www.example.com/substitutionEV; xmlns:sv=http://www.example.com/substitutionEV; !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- element name=results type=sv:ResultsType/ element name=result type=sv:ResultType/ element name=myResult type=sv:MyResultType substitutionGroup=sv:result/ complexType name=ResultsType sequence element ref=sv:result minOccurs=0 maxOccurs=unbounded/ element name=comment type=string/ /sequence /complexType complexType name=ResultType sequence element name=name type=string/ element name=value type=string/ /sequence /complexType complexType name=MyResultType complexContent extension base=sv:ResultType/ /complexContent /complexType /schema substitutionWithExtensionValues1.xml ?xml version=1.0 encoding=ASCII? sev:results xmlns:sev=http://www.example.com/substitutionEV; sev:result sev:namename1/sev:name sev:valuevalue1/sev:value /sev:result sev:myResult sev:namemyName1/sev:name sev:valuemyValue1/sev:value /sev:myResult sev:commentcomment1/sev:comment /sev:results STACKTRACE org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'myResult' not found. (http:///temp.xml, 7, 17) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:278) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:666) at org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl.doLoad(SDOXMLResourceImpl.java:585) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:634) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:266) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:239) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:97) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:79) at org.apache.tuscany.sdo.test.SubstitutionWithExtensionValuesTestCase.test(SubstitutionWithExtensionValuesTestCase.java:40) at
[jira] Updated: (TUSCANY-1812) XMLHelper.load() IOException using schema that has both a substitution group and an extension
[ https://issues.apache.org/jira/browse/TUSCANY-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ron Gavlin updated TUSCANY-1812: Attachment: tuscany-sdo.TUSCANY-1812_1830_1832.patch This is a patch for issues TUSCANY-1812, TUSCANY-1830, and TUSCANY-1832 which are all related. XMLHelper.load() IOException using schema that has both a substitution group and an extension - Key: TUSCANY-1812 URL: https://issues.apache.org/jira/browse/TUSCANY-1812 Project: Tuscany Issue Type: Bug Components: Java SDO Implementation Affects Versions: Java-SDO-Next Reporter: Ron Gavlin Priority: Critical Fix For: Java-SDO-Next Attachments: tuscany-sdo.TUSCANY-1812_1830_1832.patch Below, please find a failing Java test case and its XSD and XML test resources. Also, please find the stacktrace from the failing Java test case. It is interesting to note that this test does not fail when using dynamic SDO. Please comment if you have questions. - Ron package org.apache.tuscany.sdo.test; import java.io.IOException; import junit.framework.TestCase; import com.example.substitution.ev.SEVFactory; import commonj.sdo.DataObject; import commonj.sdo.helper.HelperContext; import commonj.sdo.helper.XMLHelper; import commonj.sdo.impl.HelperProvider; public final class SubstitutionWithExtensionValuesTestCase extends TestCase { public void test() throws IOException { HelperContext hc = HelperProvider.getDefaultContext(); SEVFactory.INSTANCE.register(hc); XMLHelper xmlHelper = hc.getXMLHelper(); DataObject loadedObject = xmlHelper.load(getClass().getResourceAsStream(/substitutionWithExtensionValues1.xml)).getRootObject(); } } substitutionWithExtensionValues.xsd schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://www.example.com/substitutionEV; xmlns:sv=http://www.example.com/substitutionEV; !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- element name=results type=sv:ResultsType/ element name=result type=sv:ResultType/ element name=myResult type=sv:MyResultType substitutionGroup=sv:result/ complexType name=ResultsType sequence element ref=sv:result minOccurs=0 maxOccurs=unbounded/ element name=comment type=string/ /sequence /complexType complexType name=ResultType sequence element name=name type=string/ element name=value type=string/ /sequence /complexType complexType name=MyResultType complexContent extension base=sv:ResultType/ /complexContent /complexType /schema substitutionWithExtensionValues1.xml ?xml version=1.0 encoding=ASCII? sev:results xmlns:sev=http://www.example.com/substitutionEV; sev:result sev:namename1/sev:name sev:valuevalue1/sev:value /sev:result sev:myResult sev:namemyName1/sev:name sev:valuemyValue1/sev:value /sev:myResult sev:commentcomment1/sev:comment /sev:results STACKTRACE org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'myResult' not found. (http:///temp.xml, 7, 17) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:278) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:666) at org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl.doLoad(SDOXMLResourceImpl.java:585) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:634) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:266) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:239) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:97) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:79) at
[jira] Updated: (TUSCANY-1812) XMLHelper.load() IOException using schema that has both a substitution group and an extension
[ https://issues.apache.org/jira/browse/TUSCANY-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ron Gavlin updated TUSCANY-1812: Description: Below, please find a failing Java test case and its XSD and XML test resources. Also, please find the stacktrace from the failing Java test case. It is interesting to note that this test does not fail when using dynamic SDO. Please comment if you have questions. - Ron package org.apache.tuscany.sdo.test; import java.io.IOException; import junit.framework.TestCase; import com.example.substitution.ev.SEVFactory; import commonj.sdo.DataObject; import commonj.sdo.helper.HelperContext; import commonj.sdo.helper.XMLHelper; import commonj.sdo.impl.HelperProvider; public final class SubstitutionWithExtensionValuesTestCase extends TestCase { public void test() throws IOException { HelperContext hc = HelperProvider.getDefaultContext(); SEVFactory.INSTANCE.register(hc); XMLHelper xmlHelper = hc.getXMLHelper(); DataObject loadedObject = xmlHelper.load(getClass().getResourceAsStream(/substitutionWithExtensionValues1.xml)).getRootObject(); } } substitutionWithExtensionValues.xsd schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://www.example.com/substitutionEV; xmlns:sv=http://www.example.com/substitutionEV; !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- element name=results type=sv:ResultsType/ element name=result type=sv:ResultType/ element name=myResult type=sv:MyResultType substitutionGroup=sv:result/ complexType name=ResultsType sequence element ref=sv:result minOccurs=0 maxOccurs=unbounded/ element name=comment type=string/ /sequence /complexType complexType name=ResultType sequence element name=name type=string/ element name=value type=string/ /sequence /complexType complexType name=MyResultType complexContent extension base=sv:ResultType/ /complexContent /complexType /schema substitutionWithExtensionValues1.xml ?xml version=1.0 encoding=ASCII? sev:results xmlns:sev=http://www.example.com/substitutionEV; sev:result sev:namename1/sev:name sev:valuevalue1/sev:value /sev:result sev:myResult sev:namemyName1/sev:name sev:valuemyValue1/sev:value /sev:myResult sev:commentcomment1/sev:comment /sev:results STACKTRACE org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'myResult' not found. (http:///temp.xml, 7, 17) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:278) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:666) at org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl.doLoad(SDOXMLResourceImpl.java:585) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:634) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:266) at org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:239) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:97) at org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:79) at org.apache.tuscany.sdo.test.SubstitutionWithExtensionValuesTestCase.test(SubstitutionWithExtensionValuesTestCase.java:40) 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:585) 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