title: java.lang.reflect.UndeclaredThrowableException: null & javax.management.InstanceNotFoundException
body: <p>i am facing issue while running spring boot application which uses activemq and JMX but getting following error while starting application
  Please do let me know if i need to modify any configuration file contents.
  I have made few changes like port 1099 in batch file.</p>
  
  <pre><code>-Dcom.sun.management.jmxremote.port=1099 
  -Dcom.sun.management.jmxremote.authenticate=false 
  -Dcom.sun.management.jmxremote.ssl=false
  </code></pre>
  
  <p>I am getting issue when accessing messagecount from the queueControl.</p>
  
  <pre><code> java.lang.reflect.UndeclaredThrowableException: null
          at com.sun.proxy.$Proxy215.getMessageCount(Unknown Source)
          at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at com.sensorthink.iot.platform.aspect.PlatformProfilerAspect.profile(PlatformProfilerAspect.java:58) at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
          at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
          at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
          at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
          at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
          at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:472)
          at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:291)
          at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:264)
          at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:178)
          at org.apache.camel.component.bean.BeanProducer.process(BeanProducer.java:41)
          at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
          at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
          at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
          at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
  
  
   at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
          at org.apache.camel.processor.Pipeline.process(Pipeline.java:83) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
          at org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:44)
          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
          at org.apache.camel.processor.loadbalancer.LoadBalancerSupport.process(LoadBalancerSupport.java:97)
          at org.apache.camel.component.quartz2.CamelJob.execute(CamelJob.java:58)
          at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
          at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
  
          Caused by: javax.management.InstanceNotFoundException: org.apache.activemq.artemis:type=Broker,brokerName="0.0.0.0",module=Core,serviceType=Queue,address="jms.queue.NEWQUE",name="jms.queue.NEWQUE"
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(Unknown Source)
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(Unknown Source)
          at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
          at sun.rmi.transport.Transport$1.run(Unknown Source)
          at sun.rmi.transport.Transport$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Unknown Source)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
          at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source) 
          at sun.rmi.server.UnicastRef.invoke(Unknown Source) 
          at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(Unknown Source)
          at javax.management.MBeanServerInvocationHandler.invoke(Unknown Source)
          ... 48 common frames omitted
  </code></pre>