How to upload image in REST ? #1188
subham-s3b
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have tried to send formdata contains text and image. But getting error while log(${body}).
2024-03-21 15:14:54.728 INFO 21984 --- [worker-thread-0] apche-demo.camel.yaml:93 : {name=Subham}
2024-03-21 15:14:54.737 WARN 21984 --- [ntloop-thread-0] ttp.vertx.VertxPlatformHttpConsumer : Failed handling platform-http endpoint /image-upload. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: java.util.HashMap to the required type: java.io.InputStream]
org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.util.HashMap to the required type: java.io.InputStream
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:199) ~[camel-base-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponseAsFallback(VertxPlatformHttpSupport.java:208) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponse(VertxPlatformHttpSupport.java:190) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$3(VertxPlatformHttpConsumer.java:206) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[vertx-core-4.5.2.jar:4.5.2]
at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60) ~[vertx-core-4.5.2.jar:4.5.2]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) [netty-transport-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
2024-03-21 15:14:54.752 ERROR 21984 --- [ntloop-thread-0] io.vertx.ext.web.RoutingContext : Unhandled exception in router
org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.util.HashMap to the required type: java.io.InputStream
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:199) ~[camel-base-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponseAsFallback(VertxPlatformHttpSupport.java:208) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponse(VertxPlatformHttpSupport.java:190) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$3(VertxPlatformHttpConsumer.java:206) ~[camel-platform-http-vertx-4.4.0.jar:4.4.0]
at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[vertx-core-4.5.2.jar:4.5.2]
at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60) ~[vertx-core-4.5.2.jar:4.5.2]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) [netty-transport-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.106.Final.jar:4.1.106.Final]
at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
Beta Was this translation helpful? Give feedback.
All reactions