sjsxp
  1. sjsxp
  2. SJSXP-12

Valid XML in JAXP is invalid / not well-formed in SJSXP

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      12

      Description

      The following XML document is treated as invalid by SJXSP, when JAXP sees no
      problem with the XML.

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE svc_result SYSTEM "MLP_SVC_RESULT_300.DTD" [<!ENTITY % extension
      SYSTEM "MOBILARIS_MLP_EXTENSION.DTD"> %extension;]><svc_result ver="3.0.0">
      <slia ver="3.0.0">
      <pos>
      <msid>46701000001</msid>
      <pd>
      <time utc_off="+0100">20061116054704</time>
      <shape>
      <CircularArcArea srsName="www.epsg.org/#4124">
      <coord>
      <X>72 00 09N</X>
      <Y>016 00 16E</Y>
      </coord>
      <inRadius>0</inRadius>
      <outRadius>500</outRadius>
      <startAngle>0</startAngle>
      <stopAngle>120</stopAngle>
      </CircularArcArea>
      </shape>
      </pd>
      </pos>
      </slia>
      </svc_result>

      XML reader error: javax.xml.stream.XMLStreamException: ParseError at
      [row,col]:[2,125]
      Message: The markup declarations contained or pointed to by the document type
      declaration must be well-formed.
      at com.sun.xml.ws.encoding.xml.XMLMessage.create(XMLMessage.java:108)
      at com.sun.xml.ws.encoding.XMLHTTPCodec.decode(XMLHTTPCodec.java:143)
      at
      com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:133)
      at com.sun.xml.ws.handler.HandlerPipe.process(HandlerPipe.java:107)
      at com.sun.xml.ws.client.Stub.process(Stub.java:121)
      at
      com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:163)
      at
      com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:189)
      at
      test.LocationRequestTestAsWebServiceClient.sendRequestAsWs(LocationRequestTestAsWebServiceClient.java:101)
      at
      test.LocationRequestTestAsWebServiceClient.testInvalidService(LocationRequestTestAsWebServiceClient.java:156)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at
      test.LocationRequestTestAsWebServiceClient.main(LocationRequestTestAsWebServiceClient.java:177)
      Caused by: XML reader error: javax.xml.stream.XMLStreamException: ParseError
      at [row,col]:[2,125]
      Message: The markup declarations contained or pointed to by the document type
      declaration must be well-formed.
      at
      com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:246)
      at
      com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:70)
      at
      com.sun.xml.ws.message.source.PayloadSourceMessage.<init>(PayloadSourceMessage.java:58)
      at
      com.sun.xml.ws.message.source.PayloadSourceMessage.<init>(PayloadSourceMessage.java:63)
      at
      com.sun.xml.ws.api.message.Messages.createUsingPayload(Messages.java:137)
      at com.sun.xml.ws.encoding.xml.XMLMessage.create(XMLMessage.java:100)
      ... 24 more

        Activity

        Hide
        ndw added a comment -

        Can you provide a copy of the DTD and any other external entities that it includes?

        Show
        ndw added a comment - Can you provide a copy of the DTD and any other external entities that it includes?
        Hide
        jsalvo added a comment -

        Created an attachment (id=3)
        GZIP file of all DTDs

        Show
        jsalvo added a comment - Created an attachment (id=3) GZIP file of all DTDs
        Hide
        jsalvo added a comment -

        I have attached the tar'd gzip file of all the related DTDs.

        Show
        jsalvo added a comment - I have attached the tar'd gzip file of all the related DTDs.
        Hide
        ndw added a comment -

        My test JAXP parser has no trouble with the document. Is this just a case of
        trying to use DTDs with web services where they aren't allowed?

        Show
        ndw added a comment - My test JAXP parser has no trouble with the document. Is this just a case of trying to use DTDs with web services where they aren't allowed?
        Hide
        ndw added a comment -

        No, it turns out to be a problem in SJSXP after all.

        If you look in com.sun.xml.stream.XMLEntityManager, you'll find two calls to
        startEntity() where the following call to endEntity() has been commented out.
        This causes the parser to get confused about where it is in the internal subset
        and, consequently, it fails to recognize the end of the internal subset. If you
        restore the calls to endEntity() this bug goes away.

        But I haven't yet been able to determine why these calls were originally
        commented out, so I'm a little reluctant to fix it that way.

        I'm still investigating.

        Show
        ndw added a comment - No, it turns out to be a problem in SJSXP after all. If you look in com.sun.xml.stream.XMLEntityManager, you'll find two calls to startEntity() where the following call to endEntity() has been commented out. This causes the parser to get confused about where it is in the internal subset and, consequently, it fails to recognize the end of the internal subset. If you restore the calls to endEntity() this bug goes away. But I haven't yet been able to determine why these calls were originally commented out, so I'm a little reluctant to fix it that way. I'm still investigating.
        Hide
        Santiago Pericas-Geertsen added a comment -

        Assigning this one to Norm since he has already worked on it.

        Show
        Santiago Pericas-Geertsen added a comment - Assigning this one to Norm since he has already worked on it.
        Hide
        ndw added a comment -

        I added a unit tests and verified that this bug has been fixed. (Santiago
        checked in the necessary changes a couple of days ago.)

        Show
        ndw added a comment - I added a unit tests and verified that this bug has been fixed. (Santiago checked in the necessary changes a couple of days ago.)

          People

          • Assignee:
            ndw
            Reporter:
            jsalvo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: