[SWS-521] UnsupportedOperationException During Validation After Upgrade From 1.5.6 to 1.5.7 Created: 27/May/09  Updated: 04/May/12  Resolved: 10/Nov/09

Status: Closed
Project: Spring Web Services
Component/s: None
Affects Version/s: 1.5.7
Fix Version/s: 1.5.9

Type: Bug Priority: Major
Reporter: Stephen Duncan Jr Assignee: Arjen Poutsma
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: 0d
Time Spent: 5m
Original Estimate: Not Specified


 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)



 Comments   
Comment by Arjen Poutsma [ 30/Jul/09 ]

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

Comment by Arjen Poutsma [ 30/Jul/09 ]

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

Comment by Stephen Duncan Jr [ 27/Aug/09 ]

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)

Comment by Arjen Poutsma [ 27/Aug/09 ]

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

Comment by Stephen Duncan Jr [ 27/Aug/09 ]

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...

Comment by Arjen Poutsma [ 10/Nov/09 ]

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

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Sun Dec 17 04:24:44 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.