Thanks for quick reply, Konrad.

Actually, I'm using - these json parsing dependencies in Gradle.

compile group: 'org.json4s', name: 'json4s-native_2.12', version: '3.2.11'
compile group: 'org.json4s', name: 'json4s-jackson_2.12', version: '3.5.0.RC1'
compile group: 'de.heikoseeberger', name: 'akka-http-json4s_2.12', version: 
'1.17.0'


And, I modified the function actually, where I'm using 
*jackson.parseJson(info)* like this -

Unmarshal(res.entity).to[String] map {
            info =>
              jackson.parseJson(info).children.length

Am I doing something wrong here?  or something wrong in Parsing using 
*json4s*?

Regards,
Aditya Borde


On Tuesday, October 10, 2017 at 9:04:22 PM UTC-4, Konrad Malawski wrote:
>
> The exception is pretty clear about something being wrong with 
> dependencies:
>
> > java.lang.NoClassDefFoundError: 
> akka/http/scaladsl/model/ContentType$WithMissingCharset
>
> How do you configure this project? 
> What’s your dependencies / build file / build system?
>
> —
> Konrad `kto.so` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 11 October 2017 at 10:02:49, bord...@gmail.com <javascript:> (
> bord...@gmail.com <javascript:>) wrote:
>
> Hello, 
>
> I'm receiving below exception in my application , *It is still showing me 
> the result once though* and application crashes :
> This is my code : This failing at *complete :*
>
> Can someone help me on this :
>
>
> val resFuture = requests.map(x => (getFutureResp(req)))
>
>
> ////////
>
> //// I'm making `complete` on the above resFuture onComplete event.
>
> ///////
>
>
> def getFutureResp(req: HttpRequest)  = {
>
>   val responseFuture = 
> Source.single(Http().singleRequest(req)).runWith(Sink.head).flatMap{
>     resultFuture => checkRespEntity(resultFuture)
>   }
>
>   responseFuture
>
> }
>
>
>     futureFlags
>
> }
>
>
> def checkRespEntity(responseFuture: Future[HttpResponse]): 
> Future[Option[Int]] = {
>
>   val futureFlags : Future[Option[Int]] = responseFuture.flatMap {
>     res =>
>       res.status match {
>         case StatusCodes.OK =>
>           Unmarshal(res.entity).to[String] map {
>             info =>
>               info.length
>               }
>               else {
>                 res.entity.dataBytes.runWith(Sink.ignore)
>
>                 None
>               }
>           }
>
>         case _ =>  {
>           res.entity.dataBytes.runWith(Sink.ignore)
>           Future{ None }
>         }
>       }
>
>     }
>
>
> *Uncaught error from thread [myactor-akka.actor.default-dispatcher-5] 
> shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for 
> ActorSystem[myactor]*
> *java.lang.NoClassDefFoundError: 
> akka/http/scaladsl/model/ContentType$WithMissingCharset*
> *at 
> akka.http.scaladsl.marshalling.Marshal.$anonfun$toResponseFor$2(Marshal.scala:51)*
> *at scala.Option.flatMap(Option.scala:171)*
> *at 
> akka.http.scaladsl.marshalling.Marshal.$anonfun$toResponseFor$1(Marshal.scala:50)*
> *at 
> akka.http.scaladsl.util.FastFuture$.$anonfun$map$1(FastFuture.scala:23)*
> *at 
> akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)*
> *at 
> akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45)*
> *at akka.http.scaladsl.util.FastFuture$.map$extension(FastFuture.scala:23)*
> *at akka.http.scaladsl.marshalling.Marshal.toResponseFor(Marshal.scala:42)*
> *at 
> akka.http.scaladsl.marshalling.ToResponseMarshallable.apply(ToResponseMarshallable.scala:17)*
> *at 
> akka.http.scaladsl.marshalling.ToResponseMarshallable.apply$(ToResponseMarshallable.scala:16)*
> *at 
> akka.http.scaladsl.marshalling.ToResponseMarshallable$$anon$1.apply(ToResponseMarshallable.scala:22)*
> *at 
> akka.http.scaladsl.server.RequestContextImpl.complete(RequestContextImpl.scala:42)*
> *at 
> akka.http.scaladsl.server.directives.RouteDirectives.$anonfun$complete$1(RouteDirectives.scala:47)*
> *at 
> akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19)*
> *at 
> akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResultWith$2(BasicDirectives.scala:67)*
> *at 
> akka.http.scaladsl.server.directives.ExecutionDirectives.handle$1(ExecutionDirectives.scala:51)*
> *at 
> akka.http.scaladsl.server.directives.ExecutionDirectives.$anonfun$handleRejections$4(ExecutionDirectives.scala:60)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$recoverRejectionsWith$1.applyOrElse(BasicDirectives.scala:91)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$recoverRejectionsWith$1.applyOrElse(BasicDirectives.scala:91)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResultWithPF$1(BasicDirectives.scala:79)*
> *at 
> akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)*
> *at 
> akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45)*
> *at 
> akka.http.scaladsl.util.FastFuture$.flatMap$extension(FastFuture.scala:26)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResultWith$2(BasicDirectives.scala:67)*
> *at 
> akka.http.scaladsl.server.directives.BasicDirectives.$anonfun$textract$2(BasicDirectives.scala:154)*
> *at 
> akka.http.scaladsl.server.directives.ExecutionDirectives.$anonfun$handleExceptions$2(ExecutionDirectives.scala:32)*
> *at 
> akka.http.scaladsl.server.Route$.$anonfun$asyncHandler$1(Route.scala:79)*
> *at akka.stream.impl.fusing.MapAsync$$anon$23.onPush(Ops.scala:1172)*
> *at 
> akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:499)*
> *at 
> akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:462)*
> *at 
> akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:368)*
> *at 
> akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:571)*
> *at 
> akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:457)*
> *at 
> akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:546)*
> *at 
> akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:725)*
> *at 
> akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:740)*
> *at akka.actor.Actor.aroundReceive(Actor.scala:513)*
> *at akka.actor.Actor.aroundReceive$(Actor.scala:511)*
> *at 
> akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:650)*
> *at akka.actor.ActorCell.receiveMessage(ActorCell.scala:527)*
> *at akka.actor.ActorCell.invoke(ActorCell.scala:496)*
> *at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)*
> *at akka.dispatch.Mailbox.run(Mailbox.scala:224)*
> *at akka.dispatch.Mailbox.exec(Mailbox.scala:234)*
> *at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)*
> *at 
> akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)*
> *at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)*
> *at 
> akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)*
> *Caused by: java.lang.ClassNotFoundException: 
> akka.http.scaladsl.model.ContentType$WithMissingCharset*
> *at java.net.URLClassLoader.findClass(URLClassLoader.java:381)*
> *at java.lang.ClassLoader.loadClass(ClassLoader.java:424)*
> *at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)*
> *at java.lang.ClassLoader.loadClass(ClassLoader.java:357)*
>
>
> Regards,
> Aditya Borde
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to akka-user+...@googlegroups.com <javascript:>.
> To post to this group, send email to akka...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to