Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6992561

Encoding of SystemId in Locator in JDK 6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      sparc
    • OS:
      solaris_9
    • Verification:
      Verified

      Backports

        Description

        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);
            }
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                joehw Joe Wang
                Reporter:
                ramap Rama Pulavarthi (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: