Relates :
|
|
Relates :
|
|
Relates :
|
The Locator set on my ContentHandler has systemId encoded which causes problem in JAX-WS (wsimport) when some parts of our runtime use the systemId originally set on the InputSource and some use from the Locator set on the ContentHandler to resolve relative references. The original issue is reported as https://jax-ws.dev.java.net/issues/show_bug.cgi?id=861. Please use the test program to reproduce the issue on JDK 6 and compare it by running on JDK 5. import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayInputStream; /** * @author Rama Pulavarthi */ public class Test { public static void main(String[] args) throws Exception { ContentHandler handler = new DefaultHandler() { public void setDocumentLocator(Locator locator) { System.out.println(locator.getSystemId()); } }; SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser parser = spf.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setContentHandler(handler); String xml= "<test>abc</test>"; ByteArrayInputStream bis =new ByteArrayInputStream(xml.getBytes()); InputSource is = new InputSource("file:/home2/ramapulavarthi/w/bugs/jaxws861/foo~bla/test/src/wsdl/HelloTypes.xsd"); is.setByteStream(bis); reader.parse(is); } }
|