How to check the connection pool with JMX in tomcat

classic Classic list List threaded Threaded
1 message Options
subusharma2001 subusharma2001
Reply | Threaded
Open this post in threaded view
|

How to check the connection pool with JMX in tomcat

Hello,

I was looking for database jdbc connection statistics using jolokia JVM plugin for tomcat web server.

While accessing the jolokia read request, i'm getting below error

URL to access: http://ServerName:8778/jolokia/read/Catalina:class=javax.sql.DataSource,name=/%22jdbc//DSNAME/%22,type=DataSource

{"request":{"path":"\/DSNAME\/\",type=DataSource","mbean":"Catalina:class=javax.sql.DataSource,name=","attribute":"\"jdbc","type":"read"},"stacktrace":"javax.management.InstanceNotFoundException: Catalina:class=javax.sql.DataSource,name=\r\n\tat com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(Unknown Source)\r\n\tat com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(Unknown Source)\r\n\tat com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(Unknown Source)\r\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:106)\r\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:37)\r\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:89)\r\n\tat org.jolokia.backend.MBeanServerExecutorLocal.handleRequest(MBeanServerExecutorLocal.java:109)\r\n\tat org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:161)\r\n\tat org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:99)\r\n\tat org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:429)\r\n\tat org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)\r\n\tat org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:197)\r\n\tat org.jolokia.http.HttpRequestHandler.handleGetRequest(HttpRequestHandler.java:86)\r\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.executeGetRequest(JolokiaHttpHandler.java:276)\r\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.doHandle(JolokiaHttpHandler.java:233)\r\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.handle(JolokiaHttpHandler.java:178)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\r\n\tat sun.net.httpserver.AuthFilter.doFilter(Unknown Source)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\r\n\tat sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\r\n\tat sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat java.lang.Thread.run(Unknown Source)\r\n","error_type":"javax.management.InstanceNotFoundException","error":"javax.management.InstanceNotFoundException : Catalina:class=javax.sql.DataSource,name=","status":404}

I want to fetch below parameter for JDBC: sessionCounter, activeSessions, expiredSessions, maxActive, rejectedSessions.

Please help