membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
94 stars 73 forks source link

Parsing schema import get to stack over flow ... #208

Open keshavarzi opened 10 years ago

keshavarzi commented 10 years ago

if a schema imports itself, parser gets to a loop and breaks with stackoverflow exception. This occurs after 5565b5c27b40894d0a12b101eec2e18314132c76

Cornstar23 commented 9 years ago

You also get this issue when a schema A includes schema B and schema B includes schema A. I think this might be specific to includes with a relative path, so if schemaA.xsd had an include for "../foo/schemaB.xsd" and schemaB.xsd had an include for "../foo/schemaA.xsd" the path of the file input stream builds unnecessary duplication like "C:\temp..\foo..\foo..\foo..\foo..\foo..\foo\schemaA.xsd"

Edit: I think this issue gets resolved if you add in com.predic8.util.HTTPUtil.normalize(path)

path = FilenameUtils.normalize(path);

using import org.apache.commons.io.FilenameUtils;