Hi community,
I’m running into a persistent issue when executing MUnit tests locally in Anypoint Studio
.
Even a
completely empty MUnit test fails with the same error.Error
org.mule.runtime.module.embedded.internal.utils.EmbeddedImplementationUtils:
Dependencies to ignore for Runtime version 4.9.12 and Java version 17: []
java.lang.IllegalStateException: Cannot create embedded container
at org.mule.runtime.module.embedded.internal.DefaultEmbeddedContainerBuilder.build(...)
at org.mule.munit.remote.container.EmbeddedContainerFactory.createContainer(...)
...
Caused by: java.lang.IllegalCallerException:
javax.naming is not open to module org.mule.runtime.jpms.utils
at java.base/java.lang.Module.addOpens(Module.java:836)
at org.mule.runtime.jpms.utils@4.9.12/org.mule.runtime.jpms.api.JpmsUtils.openToModule(...)
Environment
- Anypoint Studio: 7.23.0
- Mule Runtime: 4.9.12
- MUnit: 3.6.3
- Java: embedded JDK 17
- OS: Windows 11
- Project:
- Existing project (worked until yesterday)
- Git clone
- No recent runtime / Studio / Java upgrade
pom.xml (relevant properties):
<properties>
<app.runtime>4.9.12</app.runtime>
<munit.version>3.6.3</munit.version>
<mule-global.version>2.0.1</mule-global.version>
</properties>
What I already tried
- Clean project (Project → Clean)
- Recreated a completely empty MUnit test → same error
- Verified correct Mule Runtime 4.9.12 is configured in Studio
- changed Mule Runtime to 4.10.2
- Reinstalled Anypoint Studio from scratch
- Verified Java 17 is used (Studio requires Java ≥17)
- Deleted local Maven cache:
~/.m2/repository/org/mule
~/.m2/repository/com/mulesoft
Updated settings.xml:
- Enterprise repository configured
- Added public MuleSoft repositories:
- Run: Project --> clean
API Spec was updated recently, but:
- Issue occurs even without APIKit flows
- Happens with an empty test class
Observations
- The failure happens before any test logic runs
- The stacktrace points to JPMS / module access:
javax.naming is not open to module org.mule.runtime.jpms.utils
Looks like the embedded Mule container cannot open JDK modules
when running under Java 17
Questions
- Is Mule Runtime 4.9.12 + MUnit 3.6.x officially supported with Java 17 for embedded container execution?
- Is this a known JPMS issue in Mule 4.9.x when running MUnit?
- Are there required JVM arguments (e.g. --add-opens) that must be configured for MUnit locally?
- Has anyone solved this without upgrading the runtime?
Any help or confirmation would be highly appreciated.
Thanks in advance!
#MuleSoft
Just to be quick , I would suggest you to check MAVEN version.
or argument lin
--add-opens java.base/javax.naming=org.mule.runtime.jpms.utils
Note: As per release notes , it is fixed but there is mismatch in version for some project management tool.
Thanks,
Manish Kumar Yadav
Trailblazer Community Forum Ambassadors