Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-521

UnsupportedOperationException During Validation After Upgrade From 1.5.6 to 1.5.7

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.9
    • Component/s: None
    • Labels:
      None

      Description

      After upgrading from 1.5.6 to 1.5.7, a test where I have client-side validation turned on failed with the following stack trace. Reverting to 1.5.6 made the problem disappear:

      java.lang.UnsupportedOperationException
      at java.util.AbstractList.add(AbstractList.java:131)
      at java.util.AbstractList.add(AbstractList.java:91)
      at org.springframework.xml.namespace.SimpleNamespaceContext.bindNamespaceUri(SimpleNamespaceContext.java:108)
      at org.springframework.xml.stream.StaxStreamXmlReader.startPrefixMapping(StaxStreamXmlReader.java:171)
      at org.springframework.xml.stream.StaxStreamXmlReader.handleStartElement(StaxStreamXmlReader.java:145)
      at org.springframework.xml.stream.StaxStreamXmlReader.parseInternal(StaxStreamXmlReader.java:80)
      at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:128)
      at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:111)
      at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.validate(Unknown Source)
      at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
      at javax.xml.validation.Validator.validate(Validator.java:127)
      at org.springframework.xml.validation.Jaxp13ValidatorFactory$Jaxp13Validator.validate(Jaxp13ValidatorFactory.java:61)
      at org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor.handleRequest(AbstractValidatingInterceptor.java:171)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:542)
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:457)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:403)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:394)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:384)

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Can you supply me with a sample XML payload which triggers this behavior? That would make it a lot easier to solve.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Can you supply me with a sample XML payload which triggers this behavior? That would make it a lot easier to solve.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I think I fixed it. Can you try a recent snapshot and see if it works now?

        Show
        arjen.poutsma Arjen Poutsma added a comment - I think I fixed it. Can you try a recent snapshot and see if it works now?
        Hide
        jrduncans Stephen Duncan Jr added a comment -

        I'm sorry I wasn't able to get around to testing with a snapshot before the 1.5.8 release. I just tried with the 1.5.8 release and got the same stack trace (with a few line numbers changed in some classes):

        java.lang.UnsupportedOperationException
        at java.util.AbstractList.add(AbstractList.java:131)
        at java.util.AbstractList.add(AbstractList.java:91)
        at org.springframework.xml.namespace.SimpleNamespaceContext.bindNamespaceUri(SimpleNamespaceContext.java:115)
        at org.springframework.xml.stream.StaxStreamXmlReader.startPrefixMapping(StaxStreamXmlReader.java:171)
        at org.springframework.xml.stream.StaxStreamXmlReader.handleStartElement(StaxStreamXmlReader.java:145)
        at org.springframework.xml.stream.StaxStreamXmlReader.parseInternal(StaxStreamXmlReader.java:80)
        at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:128)
        at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:111)
        at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.validate(Unknown Source)
        at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
        at javax.xml.validation.Validator.validate(Validator.java:127)
        at org.springframework.xml.validation.Jaxp13ValidatorFactory$Jaxp13Validator.validate(Jaxp13ValidatorFactory.java:61)
        at org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor.handleRequest(AbstractValidatingInterceptor.java:171)
        at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:542)
        at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
        at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:457)
        at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:403)
        at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:394)
        at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:384)

        Show
        jrduncans Stephen Duncan Jr added a comment - I'm sorry I wasn't able to get around to testing with a snapshot before the 1.5.8 release. I just tried with the 1.5.8 release and got the same stack trace (with a few line numbers changed in some classes): java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:131) at java.util.AbstractList.add(AbstractList.java:91) at org.springframework.xml.namespace.SimpleNamespaceContext.bindNamespaceUri(SimpleNamespaceContext.java:115) at org.springframework.xml.stream.StaxStreamXmlReader.startPrefixMapping(StaxStreamXmlReader.java:171) at org.springframework.xml.stream.StaxStreamXmlReader.handleStartElement(StaxStreamXmlReader.java:145) at org.springframework.xml.stream.StaxStreamXmlReader.parseInternal(StaxStreamXmlReader.java:80) at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:128) at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:111) at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.validate(Unknown Source) at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) at javax.xml.validation.Validator.validate(Validator.java:127) at org.springframework.xml.validation.Jaxp13ValidatorFactory$Jaxp13Validator.validate(Jaxp13ValidatorFactory.java:61) at org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor.handleRequest(AbstractValidatingInterceptor.java:171) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:542) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:457) at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:403) at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:394) at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:384)
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Can you supply me with a sample XML payload which triggers this behavior? That would make it a lot easier to solve.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Can you supply me with a sample XML payload which triggers this behavior? That would make it a lot easier to solve.
        Hide
        jrduncans Stephen Duncan Jr added a comment -

        The following string triggers the exception:

        "<r:GetAllRuleSetsRequest xmlns='http://cid.cormineid.com/service/rules' xmlns:r='http://cid.cormineid.com/service/rules'/>"

        The following modification does not:

        "<GetAllRuleSetsRequest xmlns='http://cid.cormineid.com/service/rules' />"

        So, it looks like it's when there's the same namespace bound to multiple names. Please let me know if you're able to reproduce, as I plan on just fixing up the XML in these tests to avoid the problem...

        Show
        jrduncans Stephen Duncan Jr added a comment - The following string triggers the exception: "<r:GetAllRuleSetsRequest xmlns='http://cid.cormineid.com/service/rules' xmlns:r='http://cid.cormineid.com/service/rules'/>" The following modification does not: "<GetAllRuleSetsRequest xmlns='http://cid.cormineid.com/service/rules' />" So, it looks like it's when there's the same namespace bound to multiple names. Please let me know if you're able to reproduce, as I plan on just fixing up the XML in these tests to avoid the problem...
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Really fixed this time. Could you try a recent snapshot and give it a shot?

        Show
        arjen.poutsma Arjen Poutsma added a comment - Really fixed this time. Could you try a recent snapshot and give it a shot?
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            jrduncans Stephen Duncan Jr
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 5m
              5m