public void resolve(Unmarshaller u) throws JAXBException { Object obj = null; try { obj = u.unmarshal(new URL(getSchemaLocation())); } catch (MalformedURLException e) { } File file = new File(getSchemaLocation()); if (!file.exists()) { if (!file.getName().startsWith("/")) { file = new File(_location.getSystemId()); file = file.getParentFile(); if (file == null) throw new JAXBException("File not found: " + getSchemaLocation()); file = new File(file, getSchemaLocation()); } } obj = u.unmarshal(file); if (obj instanceof Schema) _schema = (Schema) obj; }