You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rdifrango <rd...@captechconsulting.com> on 2014/02/23 23:26:05 UTC

Tomcat - JMX Failure

I'm using:

Tomcat 7
Active MQ 5.9

I have a broker configured as such:



<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">

	
	<bean
	
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>file:${activemq.conf}/credentials.properties</value>
		</property>
	</bean>

	
	<broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
		brokerName="localhost" persistent="true" dataDirectory="${activemq.data}">

		<destinationPolicy>
			<policyMap>
				<policyEntries>
					<policyEntry topic=">">
						
						<pendingMessageLimitStrategy>
							<constantPendingMessageLimitStrategy
								limit="1000" />
						</pendingMessageLimitStrategy>
					</policyEntry>
				</policyEntries>
			</policyMap>
		</destinationPolicy>


		
		<managementContext>
			<managementContext createConnector="false" />
		</managementContext>

		
		<persistenceAdapter>
			<kahaDB directory="${activemq.data}/kahadb" />
		</persistenceAdapter>


		
		<systemUsage>
			<systemUsage>
				<memoryUsage>
					<memoryUsage percentOfJvmHeap="70" />
				</memoryUsage>
				<storeUsage>
					<storeUsage limit="100 gb" />
				</storeUsage>
				<tempUsage>
					<tempUsage limit="50 gb" />
				</tempUsage>
			</systemUsage>
		</systemUsage>

		
		<transportConnectors>
			
			<transportConnector name="openwire"
			
uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"
/>
		</transportConnectors>

		
		<shutdownHooks>
			<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.activemq.hooks.SpringContextHook" />
		</shutdownHooks>

	</broker>

</beans>

I start the broker in a bootstrap class as follows:

activeMqBroker = BrokerFactory.createBroker(uri);
            activeMqBroker.setUseShutdownHook(true);
            activeMqBroker.startAllConnectors();

And the minute I set the useJmx="true" my application I get the following
exception:

INFO: [127.0.0.1]:5701 [upf-dev-win-user] Address[127.0.0.1]:5701 is
SHUTTING_DOWN
ERROR ActiveMqBootstrapServiceImpl - [CorrelationId-NA] [UserId-NA]
[ApSysCd-NA] [Host-NA] [WLP-NA] [WebAnalyticsCorrelationId-NA] ActiveMQ
bootstrap issue
java.io.IOException: Transport Connector could not be registered in JMX:
org.apache.activemq:type=Broker,brokerName=localhost,connector=clientConnectors,connectorName=openwire
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)

I followed this post:

http://activemq.apache.org/tomcat.html

And yet no luck.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by mlus <ml...@39596.com>.
Hi.

You set listen ip address to 0.0.0.0  and use 61616 port  so ,
your host must open 61616 port  to open.

If you use firewall protection application, you had better stop it.
Error message says can not open 5701 port.
Do you use activemq cluster ? so, host must  open 5701 too.

> <transportConnectors>
>   <transportConnector name="openwire"
>        uri="tcp://0.0.0.0:61616?maximumConnections=1000&                   amp;wireFormat.maxFrameSize=104857600"
> />
>   </transportConnectors>



> And the minute I set the useJmx="true" my application I get the following
> exception:
>
> INFO: [127.0.0.1]:5701 [upf-dev-win-user] Address[127.0.0.1]:5701 is
> SHUTTING_DOWN
> ERROR ActiveMqBootstrapServiceImpl - [CorrelationId-NA] [UserId-NA]
> [ApSysCd-NA] [Host-NA] [WLP-NA] [WebAnalyticsCorrelationId-NA] ActiveMQ
> bootstrap issue
> java.io.IOException: Transport Connector could not be registered in JMX:
>

RE: Tomcat - JMX Failure

Posted by rdifrango <rd...@captechconsulting.com>.
The biggest thing I did is go from:

    activeMqBroker.startAllConnectors();

to

    activeMqBroker.start();

I will say it seems as if bootstrapping within Tomcat like this seems flaky so I'm going to continue working on it.

________________________________
From: artnaseef [via ActiveMQ] [ml-node+s2283324n4678330h99@n4.nabble.com]
Sent: Monday, February 24, 2014 8:52 PM
To: Ron DiFrango
Subject: Re: Tomcat - JMX Failure

The exception stack indicates the ObjectName (JMX identifier) for the broker was already registered once before.  Probably because useJmx was already set earlier.

Anyway, glad you have it working; if you can share what you did to fix the problem, that could be helpful to someone else running into the same problem.

________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678330.html
To unsubscribe from Tomcat - JMX Failure, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4678285&code=cmRpZnJhbmdvQGNhcHRlY2hjb25zdWx0aW5nLmNvbXw0Njc4Mjg1fDg5NzUyNTQ1OQ==>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678356.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by artnaseef <ar...@artnaseef.com>.
The exception stack indicates the ObjectName (JMX identifier) for the broker
was already registered once before.  Probably because useJmx was already set
earlier.

Anyway, glad you have it working; if you can share what you did to fix the
problem, that could be helpful to someone else running into the same
problem.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678330.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by rdifrango <rd...@captechconsulting.com>.
I inherited the code and config before it was completed so I'm playing
catch-up.  I'm not sure why the startAll(), I'm going to switch that.

Here's the full stack trace:

23 Feb 2014 17:37:48,371 DEBUG ActiveMqBootstrapServiceImpl:
[CorrelationId-NA] [UserId-NA] [ApSysCd-NA] [Host-NA] [WLP-NA]
[WebAnalyticsCorrelationId-NA] Config File URI:
xbean:file:C:/upf-dev/appConfig/app-common-config/environment/dev-win/activemq/upf-activemq-server-config.xml
23 Feb 2014 17:37:50,771 ERROR ActiveMqBootstrapServiceImpl:
[CorrelationId-NA] [UserId-NA] [ApSysCd-NA] [Host-NA] [WLP-NA]
[WebAnalyticsCorrelationId-NA] ActiveMQ bootstrap issue
java.io.IOException: Transport Connector could not be registered in JMX:
org.apache.activemq:type=Broker,brokerName=localhost,connector=clientConnectors,connectorName=openwire
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
	at
org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:2036)
	at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2498)
	at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2415)
	at
com.capitalone.upf.bootstrap.service.cache.ActiveMqBootstrapServiceImpl.init(ActiveMqBootstrapServiceImpl.java:59)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
	at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:295)
	at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1475)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
	at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
	at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
	at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
	at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
	at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
	at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: javax.management.InstanceAlreadyExistsException:
org.apache.activemq:type=Broker,brokerName=localhost,connector=clientConnectors,connectorName=openwire
	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
	at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
	at
org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:380)
	at
org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)
	at
org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:2033)
	... 33 more



--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678289.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by artnaseef <ar...@artnaseef.com>.
One thought, try setting useJms before starting the broker. 

Also, why call startAllConnectors directly instead of using the broker start method?

Sent from my iPhone

> On Feb 23, 2014, at 3:26 PM, "rdifrango [via ActiveMQ]" <ml...@n4.nabble.com> wrote:
> 
> I'm using: 
> 
> Tomcat 7 
> Active MQ 5.9 
> 
> I have a broker configured as such: 
> 
> 
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
> 
>         
>         <bean 
>                 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>                 <property name="locations">
>                         <value>file:${activemq.conf}/credentials.properties</value>
>                 </property>
>         </bean>
> 
>         
>         <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" 
>                 brokerName="localhost" persistent="true" dataDirectory="${activemq.data}">
> 
>                 <destinationPolicy>
>                         <policyMap>
>                                 <policyEntries>
>                                         <policyEntry topic=">"> 
>                                                 
>                                                 <pendingMessageLimitStrategy>
>                                                         <constantPendingMessageLimitStrategy 
>                                                                 limit="1000" />
>                                                 </pendingMessageLimitStrategy>
>                                         </policyEntry>
>                                 </policyEntries>
>                         </policyMap>
>                 </destinationPolicy>
> 
> 
>                 
>                 <managementContext>
>                         <managementContext createConnector="false" />
>                 </managementContext>
> 
>                 
>                 <persistenceAdapter>
>                         <kahaDB directory="${activemq.data}/kahadb" />
>                 </persistenceAdapter>
> 
> 
>                 
>                 <systemUsage>
>                         <systemUsage>
>                                 <memoryUsage>
>                                         <memoryUsage percentOfJvmHeap="70" />
>                                 </memoryUsage>
>                                 <storeUsage>
>                                         <storeUsage limit="100 gb" />
>                                 </storeUsage>
>                                 <tempUsage>
>                                         <tempUsage limit="50 gb" />
>                                 </tempUsage>
>                         </systemUsage>
>                 </systemUsage>
> 
>                 
>                 <transportConnectors>
>                         
>                         <transportConnector name="openwire" 
>                                 uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600" />
>                 </transportConnectors>
> 
>                 
>                 <shutdownHooks>
>                         <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
>                 </shutdownHooks>
> 
>         </broker>
> 
> </beans>
> 
> I start the broker in a bootstrap class as follows: 
> 
> activeMqBroker = BrokerFactory.createBroker(uri); 
>             activeMqBroker.setUseShutdownHook(true); 
>             activeMqBroker.startAllConnectors(); 
> 
> And the minute I set the useJmx="true" my application I get the following exception: 
> 
> INFO: [127.0.0.1]:5701 [upf-dev-win-user] Address[127.0.0.1]:5701 is SHUTTING_DOWN 
> ERROR ActiveMqBootstrapServiceImpl - [CorrelationId-NA] [UserId-NA] [ApSysCd-NA] [Host-NA] [WLP-NA] [WebAnalyticsCorrelationId-NA] ActiveMQ bootstrap issue 
> java.io.IOException: Transport Connector could not be registered in JMX: org.apache.activemq:type=Broker,brokerName=localhost,connector=clientConnectors,connectorName=openwire 
>         at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27) 
> 
> I followed this post: 
> 
> http://activemq.apache.org/tomcat.html
> 
> And yet no luck. 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285.html
> To start a new topic under ActiveMQ - User, email ml-node+s2283324n2341805h3@n4.nabble.com 
> To unsubscribe from ActiveMQ - User, click here.
> NAML




--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678288.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by rdifrango <rd...@captechconsulting.com>.
Got it working for the most part.  The only issue now is that it seems as if,
when my Spring Message Listeners fail with an exception [Runtime one] that
messages stop flowing.

I had a separate post on this topic.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678291.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Tomcat - JMX Failure

Posted by artnaseef <ar...@artnaseef.com>.
Is there more to that exception?  It appears the root cause of it is missing. 

Sent from my iPhone

> On Feb 23, 2014, at 3:26 PM, "rdifrango [via ActiveMQ]" <ml...@n4.nabble.com> wrote:
> 
> I'm using: 
> 
> Tomcat 7 
> Active MQ 5.9 
> 
> I have a broker configured as such: 
> 
> 
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
> 
>         
>         <bean 
>                 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>                 <property name="locations">
>                         <value>file:${activemq.conf}/credentials.properties</value>
>                 </property>
>         </bean>
> 
>         
>         <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" 
>                 brokerName="localhost" persistent="true" dataDirectory="${activemq.data}">
> 
>                 <destinationPolicy>
>                         <policyMap>
>                                 <policyEntries>
>                                         <policyEntry topic=">"> 
>                                                 
>                                                 <pendingMessageLimitStrategy>
>                                                         <constantPendingMessageLimitStrategy 
>                                                                 limit="1000" />
>                                                 </pendingMessageLimitStrategy>
>                                         </policyEntry>
>                                 </policyEntries>
>                         </policyMap>
>                 </destinationPolicy>
> 
> 
>                 
>                 <managementContext>
>                         <managementContext createConnector="false" />
>                 </managementContext>
> 
>                 
>                 <persistenceAdapter>
>                         <kahaDB directory="${activemq.data}/kahadb" />
>                 </persistenceAdapter>
> 
> 
>                 
>                 <systemUsage>
>                         <systemUsage>
>                                 <memoryUsage>
>                                         <memoryUsage percentOfJvmHeap="70" />
>                                 </memoryUsage>
>                                 <storeUsage>
>                                         <storeUsage limit="100 gb" />
>                                 </storeUsage>
>                                 <tempUsage>
>                                         <tempUsage limit="50 gb" />
>                                 </tempUsage>
>                         </systemUsage>
>                 </systemUsage>
> 
>                 
>                 <transportConnectors>
>                         
>                         <transportConnector name="openwire" 
>                                 uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600" />
>                 </transportConnectors>
> 
>                 
>                 <shutdownHooks>
>                         <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
>                 </shutdownHooks>
> 
>         </broker>
> 
> </beans>
> 
> I start the broker in a bootstrap class as follows: 
> 
> activeMqBroker = BrokerFactory.createBroker(uri); 
>             activeMqBroker.setUseShutdownHook(true); 
>             activeMqBroker.startAllConnectors(); 
> 
> And the minute I set the useJmx="true" my application I get the following exception: 
> 
> INFO: [127.0.0.1]:5701 [upf-dev-win-user] Address[127.0.0.1]:5701 is SHUTTING_DOWN 
> ERROR ActiveMqBootstrapServiceImpl - [CorrelationId-NA] [UserId-NA] [ApSysCd-NA] [Host-NA] [WLP-NA] [WebAnalyticsCorrelationId-NA] ActiveMQ bootstrap issue 
> java.io.IOException: Transport Connector could not be registered in JMX: org.apache.activemq:type=Broker,brokerName=localhost,connector=clientConnectors,connectorName=openwire 
>         at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27) 
> 
> I followed this post: 
> 
> http://activemq.apache.org/tomcat.html
> 
> And yet no luck. 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285.html
> To start a new topic under ActiveMQ - User, email ml-node+s2283324n2341805h3@n4.nabble.com 
> To unsubscribe from ActiveMQ - User, click here.
> NAML




--
View this message in context: http://activemq.2283324.n4.nabble.com/Tomcat-JMX-Failure-tp4678285p4678287.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.