Skip to content

Commit

Permalink
Document mapping service property
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkmar authored and zigzago committed Sep 24, 2021
1 parent 7d4212c commit 15a89cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kmongo-kdoc/docs/object-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,15 @@ dependency!
Choose your poison! :)

See also [Performance section](../performance).

## Explicitly defining the ClassMappingTypeService

If you get an error stating "Service ClassMappingTypeService not found", you are probably using KMongo in an environment where your application is loaded at runtime (e.g. Minecraft plugins).

To fix this error, you can set the `org.litote.mongo.mapping.service` property to the qualified class name of the service for the object mapping engine you are using. For kotlinx.serialization this would be the following:

```kotlin
System.setProperty("org.litote.mongo.mapping.service", SerializationClassMappingTypeService::class.qualifiedName!!)
```

For the class for other mappings than in the example above, see which class inherits from `ClassMappingTypeService` in your module.

0 comments on commit 15a89cb

Please sign in to comment.