Mule's Collection Splitter
is the reason for this issue.
Collection Splitter
splits the Collection object into individual objects and passes each object to the next part of the remaining flow one at a time
. Its like it is iterating the collection
and executing the remaining the flow in the loop of iteration.
Here it is a HTTP request-response
inbound. So after the collection splitter has split the collection and executed the remaining flow multiple times based on the size of the colleciton. The end response is aggregated by mule and is given back as the response. But as it is JAXWS
service the method signature might have been returning a String. So there is a class cast exception.
So two options.
Either changes the return type of the method to CopyOnWriteArraylist which provied with an output like
<response>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
<greeting>adfafasdfasdfasd</greeting>
</response>
or
Change the logic to avoid using collection splitter.
Here is more information related to Collection Splitter.