TraverseSchema will throw a NPE in its openRedefinedSchema method if the EntityResolver returns an InputSource from its resolveEntity method which has a null systemId. The source code that is causing the problem is: private void openRedefinedSchema(Element redefineDecl, SchemaInfo store) throws Exception { Attr locationAttr = redefineDecl.getAttributeNode (SchemaSymbols.ATT_SCHEMALOCATION); if (locationAttr == null) { // REVISIT: Localize fRedefineSucceeded = false; reportGenericSchemaError("a schemaLocation attribute must be specified on a <redefine> element"); return; } String location = locationAttr.getValue(); // expand it before passing it to the parser InputSource source = null; if (fEntityResolver != null) { source = fEntityResolver.resolveEntity("", location); } if (source == null) { location = expandSystemId(location, fCurrentSchemaURL); source = new InputSource(location); } // Make sure we don't redefine the same schema twice; it's allowed // but the specs encourage us to avoid it. // algorithm: string is pubId+sysId or if both null then filename String pubId = ""; String sysId = ""; if (source.getPublicId () != null) pubId = source.getPublicId (); if (source.getSystemId () != null) sysId = source.getSystemId (); if(pubId.length() != 0 || sysId.length() != 0) location += pubId+sysId; // make sure we're not redefining ourselves! if(source.getSystemId().equals(fCurrentSchemaURL)) { // NPE if source.getSystemId() == null! Possible solutions are to use the sysId variable which was previously set, or to require that the redefined schema's systemId be non-null and throw an exception with the appropriate message, or to require that either the current schema's systemId or the redefined schema's systemId be non-null and throw the appropriate exception.