You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Preben.Asmussen" <pr...@dr.dk> on 2014/02/03 12:41:08 UTC

disabeling loadStatistics

In order to disable loadStatistics (to get rid of the ManagementLoadTask
thread) I have set the ->

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <jmxAgent id="agent" loadStatisticsEnabled="false"/>
 ...
</camelContext>

But when having multiple Contexts with this setting disabled, I get an rmi
exception logged as a warning in the logs. (see stacktrace below). Does this
mean that I have to create unique context id's for each CamelContext or is
there an other way to configure this ??

I'm using camel v. 2.12.2

java.io.IOException: Cannot bind to URL [rmi://oastst20b:1099/jmxrmi/camel]:
javax.naming.NameAlreadyBoundException: jmxrmi/camel [Root exception is
java.rmi.AlreadyBoundException: jmxrmi/camel]
	at
javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804)
	at
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417)
	at
org.apache.camel.management.DefaultManagementAgent$1.run(DefaultManagementAgent.java:443)
	at java.lang.Thread.run(Thread.java:662)
Caused by: javax.naming.NameAlreadyBoundException: jmxrmi/camel [Root
exception is java.rmi.AlreadyBoundException: jmxrmi/camel]
	at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:122)
	at
com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)
	at javax.naming.InitialContext.bind(InitialContext.java:400)
	at
javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)
	at
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)
	... 2 more
Caused by: java.rmi.AlreadyBoundException: jmxrmi/camel
	at sun.rmi.registry.RegistryImpl.bind(RegistryImpl.java:131)
	at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
	at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:390)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
	at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
	at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
	at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
	at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:120)




--
View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: disabeling loadStatistics

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Hi Claus

No there is no other app where jmxAgent on purpose is set with
createConnector, but there is a lot of different versions of camel deployed,
they might create a jmxAgent by default ?

The only time the <jmxAgent is used are on the new apps. where we want to
disable loadStatistics, and here I have only used &lt;jmxAgent
id=&quot;agent&quot; loadStatisticsEnabled=&quot;false&quot;/>, that might
create the connector and register it every time it is declared in different
CamelContext's ?





--
View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709p5746739.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: disabeling loadStatistics

Posted by "Preben.Asmussen" <pr...@dr.dk>.
created https://issues.apache.org/jira/browse/CAMEL-7173



--
View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709p5746830.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: disabeling loadStatistics

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah that should have been false, as it is in camel-core. Feel free to
log a JIRA.

On Wed, Feb 5, 2014 at 10:05 AM, Preben.Asmussen <pr...@dr.dk> wrote:
> Found some time to dig into this.
>
> Figured out that I explicitly have to set the createConnector on the
> jmxAgent to 'false' then it works.
>
> The  documentation
> <http://camel.apache.org/camel-jmx.html#CamelJMX-jmxAgentPropertiesReference>
> says this should be the default value, but it seems not to be the case.
>
> The org.apache.camel.core.xml.CamelJMXAgentDefinition sets it to true ->
>  @XmlAttribute
>     private String createConnector = "true";
>
> I would guess that the default value should be set to "false".
> Should I create a jira ?
>
> Best,
> Preben
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709p5746824.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: disabeling loadStatistics

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Found some time to dig into this.

Figured out that I explicitly have to set the createConnector on the
jmxAgent to 'false' then it works.

The  documentation
<http://camel.apache.org/camel-jmx.html#CamelJMX-jmxAgentPropertiesReference>  
says this should be the default value, but it seems not to be the case. 

The org.apache.camel.core.xml.CamelJMXAgentDefinition sets it to true ->
 @XmlAttribute
    private String createConnector = "true";

I would guess that the default value should be set to "false".
Should I create a jira ?

Best,
Preben



--
View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709p5746824.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: disabeling loadStatistics

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Do you have other apps in the same JVM where you have set <jmxAgent
createConnector="true"/>. As it sounds like a 2nd connector is being
attempted created.

On Mon, Feb 3, 2014 at 12:41 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> In order to disable loadStatistics (to get rid of the ManagementLoadTask
> thread) I have set the ->
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>     <jmxAgent id="agent" loadStatisticsEnabled="false"/>
>  ...
> </camelContext>
>
> But when having multiple Contexts with this setting disabled, I get an rmi
> exception logged as a warning in the logs. (see stacktrace below). Does this
> mean that I have to create unique context id's for each CamelContext or is
> there an other way to configure this ??
>
> I'm using camel v. 2.12.2
>
> java.io.IOException: Cannot bind to URL [rmi://oastst20b:1099/jmxrmi/camel]:
> javax.naming.NameAlreadyBoundException: jmxrmi/camel [Root exception is
> java.rmi.AlreadyBoundException: jmxrmi/camel]
>         at
> javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804)
>         at
> javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417)
>         at
> org.apache.camel.management.DefaultManagementAgent$1.run(DefaultManagementAgent.java:443)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: javax.naming.NameAlreadyBoundException: jmxrmi/camel [Root
> exception is java.rmi.AlreadyBoundException: jmxrmi/camel]
>         at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:122)
>         at
> com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)
>         at javax.naming.InitialContext.bind(InitialContext.java:400)
>         at
> javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)
>         at
> javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)
>         ... 2 more
> Caused by: java.rmi.AlreadyBoundException: jmxrmi/camel
>         at sun.rmi.registry.RegistryImpl.bind(RegistryImpl.java:131)
>         at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
>         at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:390)
>         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>         at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>         at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>         at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
>         at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
>         at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
>         at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:120)
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/disabeling-loadStatistics-tp5746709.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io