java.lang.NullPointerException at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmen

ant的时候,老是ant failed, 报的错误是空指针

BUILD FAILED
build.xml:210: java.lang.NullPointerException
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.setProperty(XMLDocumentFragmentScannerImpl.java:768)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setProperty(XMLDocumentScannerImpl.java:448)
        at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.setProperty(SchemaParsingConfig.java:492)
        at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.setProperty(SchemaDOMParser.java:503)
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reset(XSDHandler.java:3594)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.reset(XMLSchemaLoader.java:1068)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:561)
        at com.sun.org.apache.xerces.internal.parsers.XMLGrammarPreparser.preparseGrammar(XMLGrammarPreparser.java:205)
        at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:78)
        at com.sun.tools.xjc.GrammarLoader.loadXMLSchema(GrammarLoader.java:330)
        at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:127)
        at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:76)
        at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:356)
        at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:305)
        at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:245)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)

最后解决的办法是把我的jdk版本从1.7换到1.6了,做一个备忘,不晓得具体原因

你可能感兴趣的:(java)