Lodehost logoLodehost

Performance and fixes

java.lang.module.ResolutionException: find the code that is on your server twice

java.lang.module.ResolutionException: Module CrashAssistant.neoforge contains package ..., module dev.kostromdan.mods.crash_assistant.core_mod exports package ... means two jars on your server hold the same Java package, and Java refuses to load the same code twice. NeoForge and Forge load every mod as a Java module, and the check runs before any mod starts, so the server stops within seconds. This guide explains what the line says in plain words, how to get from the two module names to the two files, why the package in the message changes every time you restart, and how to remove the extra copy on Lodehost.

9 min read

Configure your serverPick a plan and order your server.
A grass island with a server tower, a stone block with a single square slot, and two identical mint mod crates standing in front of that one slot next to an orange warning sign
Two crates, one slot. When two jars carry the same package, Java will not pick one and the server stops.

What java.lang.module.ResolutionException means in Minecraft

java.lang.module.ResolutionException in Minecraft means Java could not put the mods together into one set of modules, so NeoForge or Forge stopped before loading a single mod. On a NeoForge 1.21.1 server running Java 21, it came 1.7 seconds after the loader started:

NeoForge 1.21.1, in the console

[main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 11.0.5+main.901c6ea8 starting: java version 21.0.13 by Eclipse Adoptium; ...
[main/ERROR] [cpw.mods.modlauncher.ModuleLayerHandler/]: Error while resolving modules.
java.lang.module.ResolutionException: Module CrashAssistant.neoforge contains package dev.kostromdan.mods.crash_assistant.common_config.scripts.permissions, module dev.kostromdan.mods.crash_assistant.core_mod exports package dev.kostromdan.mods.crash_assistant...
 at java.base/java.lang.module.Resolver.failTwoSuppliers(Resolver.java:806) ~[?:?]
 at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:493) ~[?:?]

Since 1.17, Forge has loaded mods through the Java module system, and NeoForge builds a module for every mod from its own version of it. A module is a jar with a name and a list of packages, the folders its code sits in. By default a mod's module is fully open and shares all of its packages with the others.

Java has one firm rule here. The Java documentation for Configuration.resolve says resolution fails when two or more modules export the same package to a module that reads both, including the case where a module that contains a package reads another module that also offers it. Java will not guess which of the two copies you meant, so it stops.

Part of the lineWhat it tells you
Error while resolving modules.The loader could not build the set of modules. No mod has started yet.
Module CrashAssistant.neoforgeThe first module. It has the package in its own jar.
contains package dev.kostromdan...permissionsOne package that both jars hold. There can be many more; Java reports the first one it finds.
module dev.kostromdan.mods.crash_assistant.core_mod exports package ...The second module, which offers the same package to the first one.
Resolver.failTwoSuppliersJava's own name for the problem: two suppliers of one package.

On a server this means the same code is on it twice. That can be one mod in two files, for example two versions of it, or one mod that brings its own copy of code that another jar also carries. The fix is to keep one copy and remove the other.

"Module contains package, module exports package to": find the two jars

"Module contains package, module exports package to" names 2 modules, and each module is a jar: the name before contains package and the name after module. The package in the middle only shows what they share. To get from a module name to a file, it helps to know where the name comes from.

  • A mod can set its module name in its jar, with Automatic-Module-Name in the manifest. Forge reads that setting, so the name can look nothing like the file name.
  • Without that setting, Java makes the name from the file name: it drops .jar, cuts off the version from the first hyphen followed by a digit, and turns other characters into dots. Java's own example turns foo-bar-1.2.3-SNAPSHOT.jar into foo.bar.
  • A mod can carry other jars inside its own file, called Jar-in-Jar. Those count as modules too, and NeoForge's documentation says each one needs a module name that is unique across all loaded jars. A module name you cannot match to any file in mods may sit inside another mod.

In the case above, both names point to one mod. CrashAssistant.neoforge reads like Crash Assistant's NeoForge file, and dev.kostromdan.mods.crash_assistant.core_mod starts with the package of its author, KostromDan. Both modules contained the same packages, including copies of libraries the mod bundles under crash_assistant_relocated_libs. When both module names belong to the same mod like this, look for that mod twice: two files of it, or a file next to a copy that another jar already brings along.

When the two names belong to two different mods, the shared package tells you whose code it is. A package that starts with a mod's own name means one jar carries a copy of the other mod. A package from a general library means both mods brought that library along. In that case, check whether either mod has a newer build that does not clash, or whether you can do without one of them.

Crash Assistant does nothing on a server

Crash Assistant's Modrinth page lists it as client-side only and says it does nothing on servers. It opens a crash window on a player's computer. On a server you can remove every file of it, which fixes this case either way; players can keep it in their own game. Client-only mods covers other mods that belong on the player's side only.

Why the package in the ResolutionException changes every restart

The package in a ResolutionException can change every restart, because Java checks the shared packages in an order that differs from one run to the next and stops at the first clash. These 3 starts on the same NeoForge 1.21.1 server came within three minutes of each other:

NeoForge 1.21.1, three starts in a row

[11Nov2026 18:11:13.955] [main/ERROR] [cpw.mods.modlauncher.ModuleLayerHandler/]: Error while resolving modules.
java.lang.module.ResolutionException: Module dev.kostromdan.mods.crash_assistant.core_mod contains package crash_assistant_relocated_libs.logging.impl, module CrashAssistant.neoforge exports package crash_assistant_relocated_libs.logging.impl to dev.kostromdan...
[11Nov2026 18:12:53.361] [main/ERROR] [cpw.mods.modlauncher.ModuleLayerHandler/]: Error while resolving modules.
java.lang.module.ResolutionException: Module dev.kostromdan.mods.crash_assistant.core_mod contains package crash_assistant_relocated_libs.jexl3.scripting, module CrashAssistant.neoforge exports package crash_assistant_relocated_libs.jexl3.scripting to dev.kost...
[11Nov2026 18:14:01.743] [main/ERROR] [cpw.mods.modlauncher.ModuleLayerHandler/]: Error while resolving modules.
java.lang.module.ResolutionException: Module CrashAssistant.neoforge contains package dev.kostromdan.mods.crash_assistant.common_config.scripts.permissions, module dev.kostromdan.mods.crash_assistant.core_mod exports package dev.kostromdan.mods.crash_assistant...
StartPackage in the lineModule named first
18:11crash_assistant_relocated_libs.logging.impldev.kostromdan.mods.crash_assistant.core_mod
18:12crash_assistant_relocated_libs.jexl3.scriptingdev.kostromdan.mods.crash_assistant.core_mod
18:14dev.kostromdan.mods.crash_assistant.common_config.scripts.permissionsCrashAssistant.neoforge

Java's documentation says the order in which its fixed sets are walked through is unspecified. In Java's source, that order comes from a value picked at every start, written so the order will vary between runs. The two jars share many packages. Each start, Java meets a different one of them first, reports it and stops. That is why the package jumps around while the problem stays the same.

The pair of modules does not change, because those are the two jars that overlap. Their order can flip, as it did at 18:14: Java always writes the module that has the package in its own jar first, and which of the two that is depends on which one it was checking at that moment. So ignore the package when you compare starts, and look at the two module names. If those stay the same, you are looking at one problem, not three.

How to fix java.lang.module.ResolutionException on Lodehost

Fixing java.lang.module.ResolutionException on Lodehost takes one change: leave 1 copy of the shared code on the server instead of 2. On the panel it goes like this:

  1. Note the two module names

    Open the Console tab, or logs/latest.log on the Files tab, and find the line under Error while resolving modules. Write down the name after Module and the name after module ... exports. Skip the package.

  2. Make a backup

    On the Backups tab, make a backup before you remove anything. If you take off the wrong file, you can restore it with the server stopped.

  3. Look for two files of one mod

    On the Mods tab, look through Installed mods for the mod behind the names. With more than 20 mods, type part of the name in Filter installed mods. Two files of the same mod, such as two versions, is the clash.

  4. Check the mods folder

    Open mods on the Files tab as well. A file that was uploaded by hand shows up there too, and the file names are easier to compare side by side. Look for names that start the same way.

  5. Remove the extra copy

    Press Remove next to the file you do not want, and keep the build made for your loader and exact Minecraft version. If you are not sure which build that is, remove both and add the mod again from the Verified Modrinth catalog with Verify & install.

  6. Start the server and read the console again

    If the same two module names come back, a copy is still there, possibly inside another mod's jar. If the names are different, there was a second overlap, and you repeat the steps for that pair.

When the two modules are two different mods and neither is a spare copy, removing one is the quick way to get the server running. Then check both mods' pages for builds made for your version; a newer release of one of them may no longer carry the shared code. Players need the same mod list as the server, so remove the mod from the pack they use as well, unless it is a client-only mod. Join a modded server covers how players match the server.

"Modules export package to module" and "reads more than one module named"

"Modules X and Y export package P to module Z" and "Module X reads more than one module named Y" are 2 other forms of the same ResolutionException, written by the same part of Java. They come from Java's source code, not from a crash on one of our servers, so here they are as templates:

MessageWhat it means on a server
Module X contains package P, module Y exports package P to XX has the package itself, and Y offers it too. Two jars, one package. This is the case in this guide.
Modules X and Y export package P to module ZNeither X nor Y is the mod that needs the package. Both offer it to a third mod, Z. Look for X and Y; Z is only the mod that noticed.
Module X reads more than one module named YTwo modules with the same name. Java's documentation lists a module reading two modules with the same name as a reason resolution fails. Look for two copies of whatever Y is.

All three come down to the same rule: the code a mod uses has to come from one place. The fix is the same as well: find the jars behind the names and keep one copy.

Other messages look alike but are not this error. Missing or unsupported mandatory dependencies means a required mod is missing, see missing mod dependencies. NoClassDefFoundError means a class is not there at all, see NoClassDefFoundError. If you cannot find the error line at all, reading crash reports and logs shows where it sits.

Written and checked by the Lodehost team, last reviewed on 16 November 2026.

FAQ

ResolutionException questions

What does java.lang.module.ResolutionException mean in Minecraft?

Java could not put the mods together as modules, so NeoForge or Forge stopped before any mod loaded. With "contains package", two jars hold the same package, which means the same code is on the server twice.

What does "Error while resolving modules" mean?

It is the loader's line just before the ResolutionException. It says the set of modules could not be built. The reason and the two module names are in the line under it.

Why is the package different every time I restart?

Java checks the shared packages in an order that can change from one start to the next, and it stops at the first clash. Two jars that overlap share many packages, so each start can show another one. The two module names are what to look at.

Which of the two jars should I remove?

If both are the same mod, keep the build for your loader and exact Minecraft version and remove the other. If they are two different mods, remove the one you can do without, or look for a build of either that no longer carries the shared code.

Can a mod I cannot see in the mods folder cause it?

Yes. Mods can carry other jars inside their own file, and those load as modules too. If a module name does not match any file, it is probably inside one of the mods you do have.

Do I need Crash Assistant on my server?

No. Its Modrinth page lists it as client-side only and says it does nothing on servers. You can remove it from the server and players can keep it in their own game.

One copy of each mod, for your version.

Single NeoForge mods install from the Mods tab: mods on Modrinth with a NeoForge build for your exact version, together with what they require.

See NeoForge hosting