Java 我的xml中有什么可能导致堆栈溢出?

Java 我的xml中有什么可能导致堆栈溢出?,java,xml,Java,Xml,我正在根据已知模式验证xml,并得到一个stackoverflow错误。我的xml有什么问题?我应该找什么?该错误是从1.6Java中找到的代码中抛出的 JAXBContext context = JAXBContext.newInstance(Root.class); Unmarshaller un = context.createUnmarshaller(); SchemaFactory schemaFactory = SchemaFactory.newIns

我正在根据已知模式验证xml,并得到一个stackoverflow错误。我的xml有什么问题?我应该找什么?该错误是从1.6Java中找到的代码中抛出的

JAXBContext context = JAXBContext.newInstance(Root.class);
        Unmarshaller un = context.createUnmarshaller();
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        URL resource = ClassLoader.getSystemResource("schema.xsd");
        if (resource == null) {
            throw new IllegalStateException("Could not find schema!");
        }
        Schema schema = schemaFactory.newSchema(resource);
        un.setSchema(schema);
        Root root = un.unmarshal(xml) // Error thrown here
错误:

    java.lang.StackOverflowError
        at com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression.matchString(RegularExpression.java:1878)
        at com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression.matchString(RegularExpression.java:1878)

XML看起来像什么?XSD看起来像什么?