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)
当我试图在Camel版本更新到4.0.4和Java 17之后从camel—spring.xsd创建一个新的模式时,
代码是这样的,错误发生在最后一行:
import com.google.common.io.Resources;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.SchemaFactory;
import java.io.ByteArrayInputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
public class Camel
{
public static void main( String[] args ) throws Exception
{
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
List<Source> tmp = new ArrayList();
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);
schemaFactory.newSchema((Source[]) tmp.toArray(new Source[tmp.size()]));
}
}
你见过这个错误吗?
我已经看到camel—spring. xsd 4.x(https://camel.apache.org/schema/spring/)在circuit Breakerdef元素上有两个"onFallBack"元素,这是错误的.当我 comments 其中一个时,我没有得到一个错误.但是我不能修改jar,你知道是否有办法从xsd Camel 4.x中获取架构吗?