0 Replies Latest reply on Oct 21, 2015 1:38 PM by mlybarger

    camel route json unmarshal

    mlybarger

      i have a simple sy project that tries to unmarshal a simple json string to an object in the camel route using camel's xstream library.  i tried the jackson library, but it gives a similar error:

       

      Caused by: java.lang.IllegalArgumentException: Resolving dataformat: json-xstream detected type conflict: Not a DataFormat implementation. Found: org.apache.camel.dataformat.xstream.JsonDataFormat

       

      Here's the camel route.  SY doesn't deploy the app...

       

      
      
      
      
      public void configure() {
      
      
      
      
      XStreamDataFormat xstreamDefinition = new XStreamDataFormat();
      
      
      
              xstreamDefinition.setDriver("json");
              Map<String,String> aliases = new HashMap<String, String>();
              aliases.put("Test", Test.class.getName());
              xstreamDefinition.setAliases(aliases);
      
      
      
      
      
      
      
      
      
      
      // TODO Auto-generated method stub
      
      
      
      
      from("switchyard://JsonTest").log(
      
      
      
      
      
      
      "Received message for 'JsonTest' : ${body}")
      
      
      
      
      
      .unmarshal(xstreamDefinition);
      
      
      
      }