Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-154

ClassCastException getting faultCode in XmlResponseParser.addResult

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.1
    • None
    • Source
    • None
    • Windows server 2003

    Description

      In 3.1 XmlRpcResponseParser.addResult(Object), the following unguarded code throws a ClassCastException:

      Integer faultCode = (Integer) map.get("faultCode");

      The server (in this case Bugzilla::WebService::Bug::get_bugs.pm) might be using the wrong type (String) for faultCode , but this exception hides the true error being reported so it would be nice if the code were guarded.

      I'm using binaries from xmlrpc-3.1-bin.tar.gz.

      (As an aside, I can't figure out what Object[] to send to get_bugs: neither Integer nor String works.)

      java.lang.ClassCastException: java.lang.String incompatible with java.lang.Integer
      at org.apache.xmlrpc.parser.XmlRpcResponseParser.addResult(XmlRpcResponseParser.java:58)
      at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endValueTag(RecursiveTypeParserImpl.java:71)
      at org.apache.xmlrpc.parser.XmlRpcResponseParser.endElement(XmlRpcResponseParser.java:183)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)
      at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
      at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
      at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)
      at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
      at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
      at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
      at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)

      Thanks,
      Wes

      Attachments

        Activity

          People

            Unassigned Unassigned
            weston Wes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: