title: Camel Splitter with an own bean not working correctly when the input list is empty
body: <p>I have a routebuilder which splits the incoming json array, converts each part into XML and aggregates it back into a list and passes it to a bean which persists it. 
  As you see below, I am using an own bean which takes the incoming json array, splits it and returns a List. </p>
  
  <p>This is my route builder:</p>
  
  <pre><code>protected RouteBuilder createRouteBuilder() throws Exception {
  
      return new RouteBuilder() {
          @Override
          public void configure() throws Exception {
  
              XmlJsonDataFormat xmlJsonFormat = new XmlJsonDataFormat();
              xmlJsonFormat.setForceTopLevelObject(true);
              xmlJsonFormat.setRootName("Message");
  
              from("direct:eventprocessor")
                  .split()
                      .method(MyMessageSplitter.class)
                      .aggregationStrategy(new EventListAggregator())
                      .unmarshal(xmlJsonFormat)
                  .end()
                  .bean(new EventCreator());
          }
      };
  }
  </code></pre>
  
  <p>This is my splitter implementation:</p>
  
  <pre><code>@Handler
  public List&lt;Message&gt; splitBody(String message) throws JsonProcessingException, IOException {
  
      ObjectMapper mapper = new ObjectMapper();
      JsonNode root = mapper.readTree(message);
  
      List&lt;Message&gt; messageList = new ArrayList&lt;Message&gt;();
      if (root.isArray()) {
          for (final JsonNode jsonNode : root) {
              DefaultMessage camelMessage = new DefaultMessage();
              camelMessage.setBody(jsonNode.toString());
              messageList.add(camelMessage);
          }
      }
      return messageList;
  }
  </code></pre>
  
  <p>This is my aggregator implementation:</p>
  
  <pre><code>public class EventListAggregator implements AggregationStrategy {
  
      public EventListAggregator() {
          super();
      }
  
      public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
          Message newIn = newExchange.getIn();
  
          // add payload and headers to EsbEvent object
          EsbEvent newBody = new EsbEvent(newIn.getHeaders(), newIn.getBody(String.class));
  
          ArrayList&lt;EsbEvent&gt; list = null;
          if (oldExchange == null) {
              list = new ArrayList&lt;EsbEvent&gt;();
              list.add(newBody);
              newIn.setBody(list);
              return newExchange;
          } else {
              Message in = oldExchange.getIn();
              list = in.getBody(ArrayList.class);
              list.add(newBody);
              return oldExchange;
          }
      }
  }
  </code></pre>
  
  <p>Here the problem:
  When my route receives an empty json list, the splitter is called, returns an empty List as expected, but the EventListAggregator is never called. This leads to the problem that the following bean (EventCreator) is called with the previous payload which was a json string instead a list.</p>
  
  <pre><code>Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: java.util.List with value []
  </code></pre>
  
  <p>It works very well when I send valid data.
  Any idea what the issue could be?</p>
  
  <p>Thanks</p>