Claus Ibsen created CAMEL-27326:
-----------------------------------

             Summary: camel-jbang - transient runs at the same time fail with 
InstanceAlreadyExistsException for the JMX name transform
                 Key: CAMEL-27326
                 URL: https://issues.apache.org/jira/browse/CAMEL-27326
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


A tool that renders or reads routes without running them (the MCP tool 
{{camel_render_route_diagram}}, {{camel cmd route-diagram}} / 
{{route-structure}} on source files, {{camel transform route}}, {{camel 
validate yaml-normalize}}) boots a short-lived in-process Camel through 
{{Run.runTransform}}. Every such run names its CamelContext {{transform}} and 
keeps JMX on. When two run at the same time in one JVM, as the MCP server does 
with concurrent calls, the second one fails:

{noformat}
Failed to render route diagram 
(org.apache.camel.dsl.jbang.run.IntegrationStartException):
javax.management.InstanceAlreadyExistsException: 
org.apache.camel:context=transform,type=context,name="transform"
{noformat}

{{RouteDiagramToolsTest.callsAtTheSameTime}} fails this way from time to time; 
it failed twice in full runs of camel-jbang-mcp on 2026-11-21 and passed on 
rerun. CAMEL-27156 fixed the shared work directory of the same test, not this.

Fix: a transform run does not need JMX (it only dumps the route structure to 
files), so it runs with {{camel.main.jmxEnabled=false}}, as it already runs 
silent and stubbed.

_Created by Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to