---
title: "Comment by Jasman Arora on \"Using MongoDB in Ktor.\" | Hashnode"
description: "The blog is awesome but when I try to run the app then I am getting the following exception 2021-10-14 11:22:37.244 [cluster-ClusterId{value=&#39;6167c5a470b9a4"
url: "https://hashnode.com/posts/mongodb-in-ktor/60db92c57c7df7644acddf01/comment/6167c7d218374f257327871f"
---

[Discussion](https://hashnode.com/posts/mongodb-in-ktor/60db92c57c7df7644acddf01)

Comment [Using MongoDB in Ktor.](https://hashnode.com/posts/mongodb-in-ktor/60db92c57c7df7644acddf01)

[Jasman Arora](https://hashnode.com/@RunnerShane)

[Oct 14, 2021](https://hashnode.com/posts/mongodb-in-ktor/60db92c57c7df7644acddf01/comment/6167c7d218374f257327871f)

The blog is awesome but when I try to run the app then I am getting the following exception

2021-10-14 11:22:37.244 \[cluster-ClusterId{value='6167c5a470b9a401ce681185', description='null'}-localhost:27017\] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server localhost:27017 com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.internal.connection.AsynchronousSocketChannelStream$OpenCompletionHandler.failed(AsynchronousSocketChannelStream.java:124) at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:129) at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.net.ConnectException: Connection refused at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method) at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252) at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198) at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213) at java.base/sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:306) ... 1 common frames omitted

so can you help me solve this
