java.lang.LinkageError: attempted duplicate class definition
<p>Why does the error happen and how do I fix it?</p>

<pre><code>[02:13:02] [pool-4-thread-2/WARN]: Exception in thread "pool-4-thread-2" 
[02:13:02] [pool-4-thread-2/WARN]: java.lang.LinkageError: loader (instance of  org/bukkit/plugin/java/PluginClassLoader): attempted  duplicate class definition for name: "com/mongodb/client/model/Filters"
[02:13:02] [pool-4-thread-2/WARN]:  at java.lang.ClassLoader.defineClass1(Native Method)
[02:13:02] [pool-4-thread-2/WARN]:  at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
[02:13:02] [pool-4-thread-2/WARN]:  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[02:13:02] [pool-4-thread-2/WARN]:  at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
[02:13:02] [pool-4-thread-2/WARN]:  at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
[02:13:02] [pool-4-thread-2/WARN]:  at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
[02:13:02] [pool-4-thread-2/WARN]:  at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
[02:13:02] [pool-4-thread-2/WARN]:  at java.security.AccessController.doPrivileged(Native Method)
[02:13:02] [pool-4-thread-2/WARN]:  at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[02:13:02] [pool-4-thread-2/WARN]:  at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101)
[02:13:02] [pool-4-thread-2/WARN]:  at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:195)
[02:13:02] [pool-4-thread-2/WARN]:  at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:97)
[02:13:02] [pool-4-thread-2/WARN]:  at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86)
[02:13:02] [pool-4-thread-2/WARN]:  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[02:13:02] [pool-4-thread-2/WARN]:  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[02:13:02] [pool-4-thread-2/WARN]:  at me.franzsan.data.mongo.MongoCharacter.existsCharacter(MongoCharacter.java:109)
[02:13:02] [pool-4-thread-2/WARN]:  at me.franzsan.data.mongo.MongoCharacter.lambda$loadCharacter$0(MongoCharacter.java:44)
[02:13:02] [pool-4-thread-2/WARN]:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[02:13:02] [pool-4-thread-2/WARN]:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[02:13:02] [pool-4-thread-2/WARN]:  at java.lang.Thread.run(Thread.java:745)
</code></pre>

<p>This is the line that causes the error</p>

<pre><code>FindIterable cursor = connection.getCharacters().find(Filters.eq("uuid", uuid));
</code></pre>

<p>And then there is also this. It's from another module and both should be executed asynchronously at the same time (or shortly after one another, because I think right now I have only one thread). This one works without error.</p>

<pre><code>FindIterable cursor = connection.getPlayers().find(Filters.eq("uuid", id));
</code></pre>

<p>Filters.eq is a static method.</p>

<p>Both are using the same</p>

<pre><code>ExecutorService pool = Executors.newCachedThreadPool();
</code></pre>

<p>I feel like i'm lacking crucial knowledge, but I have no idea where to look fo rit.</p>