Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16114

DataFormat UnmarshalType defined as an Array Class Fails in Java DSL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.1
    • Fix Version/s: 3.7.2, 3.8.0
    • Component/s: camel-jackson
    • Labels:
      None
    • Environment:

      Camel 3.7.1

      Apache Karaf 4.2.10

    • Estimated Complexity:
      Unknown

      Description

      On camel 2.x and early versions of 3.x you could specify an unmarshal type that is an array

      EX

      from("direct:beginArray").unmarshal().json(JsonLibrary.Jackson, String[].class).to("mock:endArray");
       

      I've upgraded to Camel 3.7.1 and this now throws an exception

       

      java.lang.IllegalArgumentException: Unrecognized Type: [null]
      	at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1263)
      	at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:657)
      	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3242)
      	at org.apache.camel.component.jackson.JacksonDataFormat.unmarshal(JacksonDataFormat.java:183)
      	at org.apache.camel.support.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:64)
      	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
      	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
      	at org.apache.camel.component.netty.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:142)
      	at org.apache.camel.component.netty.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:113)
      	at org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler.channelRead0(HttpServerChannelHandler.java:221)
      	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
      	at org.apache.camel.component.netty.http.handlers.HttpServerMultiplexChannelHandler.channelRead0(HttpServerMultiplexChannelHandler.java:162)
      	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
      	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:59)
      	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:368)
      	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      	at java.lang.Thread.run(Thread.java:748) 

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                bob Bob Paulin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: