MBean (JMX) Monitoring and Management

355 views
Skip to first unread message

arun kumar

unread,
Dec 20, 2018, 2:23:56 AM12/20/18
to HikariCP
While using MBean (JMX) Monitoring and Management  

I have received this error

java.lang.RuntimeException: javax.management.InstanceNotFoundException: com.zaxxer.hikari:type=Pool 


Hikari version : 3.2.0
Database : oracle

Hikari Config:

 config.setDriverClassName("oracle.jdbc.driver.OracleDriver");
        config.setJdbcUrl( "jdbc:oracle:thin:@xx.xx.xx.xx:xxx:arun" );
        config.setUsername( "xx" );
        config.setPassword( "xxx" );
        config.addDataSourceProperty( "cachePrepStmts" , "true" );
        config.addDataSourceProperty( "prepStmtCacheSize" , "250" );
        config.addDataSourceProperty( "prepStmtCacheSqlLimit" , "2048" );
        config.setPoolName("insurance");
        config.setRegisterMbeans(true);
        config.setAllowPoolSuspension(true);
        
        ds = new HikariDataSource( config );


Brett Wooldridge

unread,
Dec 21, 2018, 4:08:32 AM12/21/18
to HikariCP
You'll want to make sure that your pool as an assigned name.  Then you need to use that name as part of the JMX lookup.  For example:

ObjectName poolName = new ObjectName("com.zaxxer.hikari:type=Pool (foo)");

where "foo" is the name you assigned to the pool.

-Brett

arun kumar

unread,
Dec 24, 2018, 2:05:07 AM12/24/18
to HikariCP
I have used the sample poolName in ObjectName creation.

-Arun

arun kumar

unread,
Dec 24, 2018, 4:11:14 AM12/24/18
to HikariCP
Its working. 


On Friday, 21 December 2018 14:38:32 UTC+5:30, Brett Wooldridge wrote:
Reply all
Reply to author
Forward
0 new messages