camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Tam" <email.w...@gmail.com>
Subject Re: Starting Camel context causes JMX exception.
Date Mon, 07 Jul 2008 01:37:45 GMT
Hi Sergey,

It looks like the instrumentation agent should handle mbeans that have
already been registered.   It should catch the
InstanceAlreadyExistsException and continue.  I'll open a JIRA.  BTW,
the reason you start seeing the exception in 1.4 is because JMX is now
enabled by default.  If you need to disable it, please follow the wiki
 http://activemq.apache.org/camel/camel-jmx.html.

Thanks,
William


On Sun, Jul 6, 2008 at 2:46 PM, S.R. <srassokhin@gmail.com> wrote:
>
> When Camel context is starting
> javax.management.InstanceAlreadyExistsException is thrown.
>
> This happens ONLY for 1.4.0 version AND if the route has 2 equal bean
> endpoints, for example:
> from("jms:queue").to("bean:testBean?methodName=test").to("bean:testBean?methodName=test")
> or
> from("jms:queue").to("bean:testBean").to("bean:testBean").
>
> However, the following example doesn't cause that exception:
> from("jms:queue").to("bean:testBean?methodName=test1").to("bean:testBean?methodName=test2").
>
> Original stack trace:
> WARNING: Could not register Counter MBean
> javax.management.InstanceAlreadyExistsException:
> org.apache.camel:context=srassokhin-pc/camelContext,route=[jms]Queue.IMB.System@-2079852353,type=processor,name="To[bean:systemReplyBean\?methodName=replyLogin]"
>        at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
>        at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
>        at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
>        at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
>        at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
>        at
> com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
>        at
> org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(DefaultInstrumentationAgent.java:224)
>        at
> org.apache.camel.management.DefaultInstrumentationAgent.register(DefaultInstrumentationAgent.java:165)
>        at
> org.apache.camel.management.DefaultInstrumentationAgent.register(DefaultInstrumentationAgent.java:146)
>        at
> org.apache.camel.management.InstrumentationLifecycleStrategy.onRouteContextCreate(InstrumentationLifecycleStrategy.java:173)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:216)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>        at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>        at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>        at
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>        at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>
> Sergey
>
> --
> View this message in context: http://www.nabble.com/Starting-Camel-context-causes-JMX-exception.-tp18304692s22882p18304692.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message