title: CXF Error Unmarshalling Error UnsupportedOperationException
body: <p>TL;DR For some reason I can't unmarshall a fairly simple object in a Java-first web service using CXF.</p>
  
  <p>I have a Java-First CXF Web Service with an API similar to:</p>
  
  <pre><code>@WebMethod
  public SearchResponse search(@WebParam(name = "searchRequest") SearchRequest searchRequest);    
  </code></pre>
  
  <p>The response (the class that won't unmarshall) is roughly:</p>
  
  <pre><code>public class SearchResponse {
  
      private List&lt;SearchResult&gt; results;
      public List&lt;SearchResult&gt; getResults() {
          return results;
      }
      public void setResults(List&lt;SearchResult&gt; results) {
          this.results = results;
      }
  }
  </code></pre>
  
  <p>SearchResult is a dead-simple two property class:</p>
  
  <pre><code>public class SearchResult {
      private long id;
      private String name;
  
      public long getId() {
          return id;
      }
      public void setId(long id) {
          this.id = id;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>I can call this service through Soap-UI and it works perfectly. However, when I call using a jaxws client I get an error:</p>
  
  <pre><code>javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: null 
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:143)
      at $Proxy67.search(Unknown Source)
      at com.blah.MyTest.curseYouSearch(MyTest.java:76)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
      at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
      at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
      at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
      at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
      at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
      at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
      at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: java.lang.UnsupportedOperationException
      at java.util.AbstractList.add(AbstractList.java:131)
      at java.util.AbstractList.add(AbstractList.java:91)
      at com.sun.xml.internal.bind.v2.runtime.reflect.Lister$CollectionLister.addToPack(Lister.java:290)
      at com.sun.xml.internal.bind.v2.runtime.reflect.Lister$CollectionLister.addToPack(Lister.java:254)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope.add(Scope.java:106)
      at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty$ReceiverImpl.receive(ArrayERProperty.java:195)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:524)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:206)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:170)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:351)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:330)
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:610)
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:530)
      at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:114)
      at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:99)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
      ... 24 more
  </code></pre>
  
  <p>I can set a breakpoint on AbstractList.add and based on the resulting stack it appears unmarshalling is attempting to add to the empty list, which of course is immutable:</p>
  
  <pre><code>Thread [main] (Suspended (breakpoint at line 131 in AbstractList))  
      Collections$EmptyList(AbstractList&lt;E&gt;).add(int, E) line: 131    
      Collections$EmptyList(AbstractList&lt;E&gt;).add(E) line: 91  
      Lister$CollectionLister&lt;BeanT,T&gt;.addToPack(T, Object) line: 290 
      Lister$CollectionLister&lt;BeanT,T&gt;.addToPack(Object, Object) line: 254    
      Scope&lt;BeanT,PropT,ItemT,PackT&gt;.add(Accessor&lt;BeanT,PropT&gt;, Lister&lt;BeanT,PropT,ItemT,PackT&gt;, ItemT) line: 106 
      ArrayERProperty$ReceiverImpl.receive(UnmarshallingContext$State, Object) line: 195  
      UnmarshallingContext.endElement(TagName) line: 524  
      StAXStreamConnector.handleEndElement() line: 206    
      StAXStreamConnector.bridge() line: 170  
      UnmarshallerImpl.unmarshal0(XMLStreamReader, JaxBeanInfo) line: 351 
      UnmarshallerImpl.unmarshal(XMLStreamReader, Class&lt;T&gt;) line: 330 
      JAXBEncoderDecoder.unmarshall(Unmarshaller, Object, QName, Class&lt;?&gt;, boolean) line: 610 
      JAXBEncoderDecoder.unmarshall(Unmarshaller, Object, MessagePartInfo, boolean) line: 530 
      DataReaderImpl&lt;T&gt;.read(MessagePartInfo, T) line: 114    
      DocLiteralInInterceptor.handleMessage(Message) line: 99 
      PhaseInterceptorChain.doIntercept(Message) line: 236    
      ClientImpl.onMessage(Message) line: 658 
      HTTPConduit$WrappedOutputStream.handleResponseInternal() line: 2139 
      HTTPConduit$WrappedOutputStream.handleResponse() line: 2022 
      HTTPConduit$WrappedOutputStream.close() line: 1947  
      HTTPConduit(AbstractConduit).close(Message) line: 66    
      HTTPConduit.close(Message) line: 632    
      MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(Message) line: 62 
      PhaseInterceptorChain.doIntercept(Message) line: 236    
      ClientImpl.invoke(BindingOperationInfo, Object[], Map&lt;String,Object&gt;, Exchange) line: 472   
      ClientImpl.invoke(BindingOperationInfo, Object[], Exchange) line: 302   
      ClientImpl.invoke(BindingOperationInfo, Object...) line: 254    
      JaxWsClientProxy(ClientProxy).invokeSync(Method, BindingOperationInfo, Object[]) line: 73   
      JaxWsClientProxy.invoke(Object, Method, Object[]) line: 123 
      ...endless stack lines omitted...
  </code></pre>
  
  <p>My client is setup in Spring as a jaxws:client:</p>
  
  <pre><code>&lt;jaxws:client id="searchServiceClient"
      serviceClass="qualified.class.of.Service"
      address="${url.searchService}"&gt;
  &lt;/jaxws:client&gt;   
  </code></pre>
  
  <p>We have numerous other web services that return List in a very similar fashion and work fine; I am somewhat at a loss as to what the difference is with this one.</p>
  
  <p>The system is using Java 6, CXF 2.2.3. </p>
  
  <p>Any suggestions would be most welcome.</p>