AbstractJaxbProvider extends AbstractMessageReaderWriterProvider<T> { protected static SAXSource getSAXSource(SAXParserFactory spf, InputStream entityStream) throws JAXBException { try { return new SAXSource(spf.newSAXParser().getXMLReader(), new InputSource(entityStream)); } catch (Exception ex) { throw new JAXBException("Error creating SAXSource", ex); } } AbstractJaxbProvider(final Providers providers);  AbstractJaxbProvider(final Providers providers, final MediaType resolverMediaType); @Context void setConfiguration(final Configuration config);  }
@Test public void abstractJaxbProviderDoesNotReadExternalDtds() throws Exception { SAXParserFactory spf = injectionManager.getInstance(SAXParserFactory.class); String url = "file: String s = "<!DOCTYPE x SYSTEM '" + url + "'><x/>"; SAXSource saxSource = AbstractJaxbProvider.getSAXSource(spf, new ByteArrayInputStream(s.getBytes("us-ascii"))); TransformerFactory.newInstance().newTransformer().transform(saxSource, new StreamResult(new ByteArrayOutputStream())); }