Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.20.0, 2.20.1
-
None
-
Unknown
Description
When running the camel-example-spring-boot-xml, or any spring-boot camel application using xml route definition, camel seems to create 2 contexts.
It seems to happen only when using spring xml routes.
The second one has no routes. Camel fails to register it to jmx and adds a "-1" to its name.
a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
The relevant parts of the trace:
2018-01-10 12:00:26.538 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting 2018-01-10 12:00:26.539 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled 2018-01-10 12:00:26.700 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html 2018-01-10 12:00:26.740 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Route: hello started and consuming from: timer://hello?period=2000 2018-01-10 12:00:26.742 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started 2018-01-10 12:00:26.743 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.204 seconds 2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting 2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled 2018-01-10 12:00:26.757 WARN 11245 --- [ main] a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer. 2018-01-10 12:00:26.762 INFO 11245 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Type converters loaded (core: 193, classpath: 1) 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 0 routes, of which 0 are started 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.013 seconds