I have the following code in Kotlin which I aim to use it to convert any instance to a base64 encoded string. The same is not working and it throws the following error :

```
Serializer for class 'Any' is not found.\nMark the class as @Serializable or provide the serializer explicitly

```

How can I fix this?

```
class SerializerAdapter: SerializerPort {
  private val logger: Logger = LoggerFactory.getLogger(javaClass.simpleName)
  override fun toBase64(input: Any): String {
    try {
      val jsonString = Json.encodeToString(input)
      return Base64.getEncoder().encodeToString(jsonString.toByteArray())
    }catch (ex: Exception) {
      logger.error("[BASE64 Error] error converting json object to base64 encoded string: ${ex.stackTraceToString()}")
    }finally {
      return ""
    }
  }
}

```