Troubleshooting
Solutions for common module development issues
Solutions for common issues when developing BoxLang modules.
Module not loading / not found
Symptoms: Module doesn't appear in the registry, BIFs aren't available.
Checklist:
Verify
box.jsonmoduleName— Ensureboxlang.moduleNameis set correctly{ "boxlang": { "moduleName": "myModule" } }Check module path — The module directory must be in a scanned location (default:
./modules/or as configured inmodulesDirectory)Check
enabledflag —this.enabled = truein ModuleConfig.bx, not overridden tofalsein runtime configCheck for descriptor conflicts — If both ModuleConfig.bx and Java IModuleConfig exist, Java wins and BX is ignored
Verify ModuleConfig.bx exists at the module root
If the module is nested inside another — check the containing module too. A disabled or failed parent skips every module nested inside it, since their class loaders chain to its own. Its parent may also have disabled it via
this.modules. See Module InceptionIf the module is a JAR — it must expose an
IModuleConfigthroughMETA-INF/services/ortus.boxlang.runtime.modules.IModuleConfig. A JAR without one is disabled with a warning. Note the module is named after the JAR file unless@BoxModule( name )says otherwiseCheck logs — Enable debug logging for the module service:
{ "logging": { "loggers": { "modules": { "level": "DEBUG" } } } }
Class not found when using @moduleName
Symptoms: import models.MyClass@myModule throws "Class not found".
Solutions:
Verify the module is loaded and activated —
@moduleNameonly works for active modulesboxRuntime.getModuleService().hasModule( "myModule" )Check the class path — Path is relative to the module root
// Module root: /path/to/myModule/ // Class at: /path/to/myModule/models/MyClass.bx // Import: import models.MyClass@myModule ✅For Java classes, verify they're in the module's JAR or
libs/folderCheck ServiceLoader config for Java classes — ensure the class is listed in the correct services file
BIF not callable after module load
Symptoms: Module loads without errors, but BIFs aren't available.
Solutions:
For BoxLang BIFs — Files must be in the
bifs/folder at the module rootFor Java BIFs — Class must be
@BoxBIFannotated AND listed inMETA-INF/services/ortus.boxlang.runtime.bifs.BIFCheck naming conventions — The member function name is derived from the class name (e.g.,
SetAdd→add)Check for registration errors in the module service log
Dependency not activating
Symptoms: Module declares this.dependencies = [ "otherModule" ] but otherModule isn't activating first.
Solutions:
Verify the dependency module is discoverable — It must be in a scanned module path
Check dependency name — Must match the registered module name (from
box.jsonboxlang.moduleNameor directory name)Dependencies are activated recursively — If the dependency fails, its dependents won't activate either
Missing dependencies don't prevent activation — They log a warning but allow the module to proceed
Version incompatibility error
Symptoms: "Module [X] requires BoxLang version [Y] but we are running [Z]"
Solutions:
Update BoxLang to match or exceed the module's
minimumVersionUpdate
minimumVersionin yourbox.jsonto match the runtime you're targetingDevelopment mode — BoxLang
0.x.xversions skip version checks
Class loader / JAR conflict
Symptoms: NoClassDefFoundError, ClassNotFoundException, or unexpected behavior from a library.
Solutions:
Check for conflicting JARs — Use
./gradlew dependenciesto inspect the dependency treeShadow conflicting dependencies — The shadow JAR plugin can relocate packages to avoid conflicts
Isolate your classes — Ensure compiled classes use the
modules.{moduleName}package prefixMove JARs to
libs/— External JARs inlibs/are loaded with module-level isolationCheck the containing module — A nested module inherits its parent's class loader, so a conflicting JAR in the parent's
libs/is visible to it. Sibling modules are still isolated from each otherWalk the chain correctly — Module loaders track their parent themselves, so
getParent()returnsnull. UseDynamicClassLoader.getDynamicParent()when inspecting the hierarchy
Interceptor not firing
Symptoms: Registered an interceptor but event methods aren't being called.
Solutions:
Verify interceptor registration — In
configure():Check class path — The class path is relative to the module root
Check event names — Method names must match the event name exactly (e.g.,
onRequestStart, notonrequeststart)For Java interceptors — Implement
IInterceptor, use@InterceptionPoint, and register via ServiceLoader
onUnload cleanup not running
Symptoms: Module resources aren't cleaned up on module unload or runtime shutdown.
Solutions:
Wrap cleanup in try/catch — An unhandled exception in
onUnload()will abort cleanupCheck unload order — Modules are unloaded in reverse activation order
Verify unload is called — Add a log statement to confirm
onUnload()executes
Public assets returning 404
Symptoms: Files in public/ folder aren't accessible via HTTP.
Solutions:
Verify the file path —
public/css/style.css→ URL:/bxModules/myModule/public/css/style.cssCheck custom mapping — If
this.publicMappingis overridden, use the custom URL pathEnsure module is activated — Public mappings are only available after activation
Check web server configuration — Ensure the
/bxModules/path isn't blocked
Getting Help
If you're still stuck:
Check the logs — Enable debug logging for more details
Reference real modules — Study open-source modules at github.com/ortus-boxlang
Use GitHub Issues — Search for similar issues in the BoxLang repository
Community — Reach out on the BoxLang community channels
Last updated
Was this helpful?
