0 Replies Latest reply on Oct 17, 2015 12:02 AM by bagus sugitayasa

    Data format 'json-jackson' could not be created

    bagus sugitayasa Newbie

      Hi everyone,

      I have a simple route like this,

      <routes xmlns="http://camel.apache.org/schema/spring">

        <route>

          <from uri="switchyard://IObjectMapper"/>

               <log message="IObjectMapper - JSON Request: ${

               <process ref="BookServiceMappingProcess"/>

               <log message="JSON Response: ${body}"/>

          <to uri="switchyard://IBookService"/>

               <process ref="BookResultProcess"/>

               <marshal>

                    <json library="Jackson" prettyPrint="true"/>

               </marshal>

               <log message="IBookService Response: ${body}"/>

        </route>

      </routes>

       

      I expect result message with json formatted, so I try to marshal message body using Jackson library.
      If I try to deploy the app to the JBoss EAP, Failed to start service with error bellow:

      ------------

      Caused by: java.lang.IllegalArgumentException: Data format 'json-jackson' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath

        at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:89)

        at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:79)

        at org.apache.camel.model.UnmarshalDefinition.createProcessor(UnmarshalDefinition.java:156)

        at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)

        at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)

        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:876)

        ... 15 more

       

      If I mark,

      <marshal>
            <json library="Jackson" prettyPrint="true"/>
      </marshal>

       

      the app success to deploy and running well, but i don't get message body as json formatted.

      I don't have any clue for fix this issue. Please any kind of advise..

       

      Regards,

      bGita.