Код: Выделить всё
org.xml.sax.SAXParseException; lineNumber: 4268; columnNumber: 51; cos-nonambig: "http://camel.apache.org/schema/spring":onFallback and "http://camel.apache.org/schema/spring":onFallback (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XSConstraints.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XSConstraints.fullSchemaChecking(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
код такой, и ошибка возникает в последней строке:
Код: Выделить всё
SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
String loc = "camel-spring.xsd";
URL url = Resources.getResource(loc);
byte[] bytes = Resources.toByteArray(url);
StreamSource src = new StreamSource(new ByteArrayInputStream(bytes));
tmp.add(src);
Schema schema = schemaFactory.newSchema((Source[])tmp.toArray(newSource[tmp.size()]));
We tried to update spring version and xerces version to the lastest. But we still are getting errors.
Источник: https://stackoverflow.com/questions/781 ... th-camel-4