Discussion:
[dbcp] Exposing JMXbeans
Walter Heestermans (TME)
2017-12-08 12:47:24 UTC
Permalink
Hi,

We have Struts application using the commons DBCP and commons Pool implementation. I like to have the pool information exposed as JMX beans, so that I can use JConsole to look a t the pool behaviour. The application is deployed inside a Jetty container. I can see a lot of info already via JConsole but the pool information is missing.

What is required to be able to do that?

Regards
Walter


This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.
Mark Thomas
2017-12-08 12:57:34 UTC
Permalink
Post by Walter Heestermans (TME)
Hi,
We have Struts application using the commons DBCP and commons Pool implementation. I like to have the pool information exposed as JMX beans, so that I can use JConsole to look a t the pool behaviour. The application is deployed inside a Jetty container. I can see a lot of info already via JConsole but the pool information is missing.
What is required to be able to do that?
A good place to start would be you telling the list which versions of
Commons DBCP and Commons Pool are being used.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Walter Heestermans (TME)
2017-12-08 12:59:32 UTC
Permalink
We are using:

commons-dbcp2-2.1.1.jar
commons-pool2-2.4.3.jar

Walter


-----Original Message-----
From: Mark Thomas [mailto:***@apache.org]
Sent: 08 December 2017 13:58
To: ***@commons.apache.org
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
Hi,
We have Struts application using the commons DBCP and commons Pool implementation. I like to have the pool information exposed as JMX beans, so that I can use JConsole to look a t the pool behaviour. The application is deployed inside a Jetty container. I can see a lot of info already via JConsole but the pool information is missing.
What is required to be able to do that?
A good place to start would be you telling the list which versions of Commons DBCP and Commons Pool are being used.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org

This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Mark Thomas
2017-12-08 14:10:36 UTC
Permalink
Post by Walter Heestermans (TME)
commons-dbcp2-2.1.1.jar
commons-pool2-2.4.3.jar
Set the jmxName property on your BasicDataSourceFcatory and that will
enable JMX for DBCP and the underlying pools.

Mark
Post by Walter Heestermans (TME)
Walter
-----Original Message-----
Sent: 08 December 2017 13:58
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
Hi,
We have Struts application using the commons DBCP and commons Pool implementation. I like to have the pool information exposed as JMX beans, so that I can use JConsole to look a t the pool behaviour. The application is deployed inside a Jetty container. I can see a lot of info already via JConsole but the pool information is missing.
What is required to be able to do that?
A good place to start would be you telling the list which versions of Commons DBCP and Commons Pool are being used.
Mark
---------------------------------------------------------------------
This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Walter Heestermans (TME)
2017-12-08 14:28:59 UTC
Permalink
This is what has been coded by the project








public static void setUp() throws Exception {

// Load JDBC Driver class.

Class.forName(DatabaseProperties.DB_DRIVER).newInstance();



connectionPool = new BasicDataSource();



connectionPool.setUsername(DatabaseProperties.DB_USER);

connectionPool.setPassword(DatabaseProperties.DB_PASSWORD);

connectionPool.setDriverClassName(DatabaseProperties.DB_DRIVER);

connectionPool.setUrl(DatabaseProperties.DB_URL);

connectionPool.setInitialSize(0);

connectionPool.setValidationQuery(DatabaseProperties.DB_PREFERRED_TEST_QUERY);

connectionPool.setMaxIdle(DatabaseProperties.DB_MAX_IDLE);

connectionPool.setMinIdle(DatabaseProperties.DB_MIN_IDLE);

//connectionPool.setMaxActive(Integer.parseInt(DatabaseProperties.DB_MAX_POOL_SIZE));

connectionPool.setMinEvictableIdleTimeMillis(DatabaseProperties.DB_MIN_EVICTABLE_IDLE_TME_MILIS);

connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");








Nothing in jconsole



[cid:***@01D37038.31DBE350]



Maybe related to the name they use?



connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");



Walter





-----Original Message-----
From: Mark Thomas [mailto:***@apache.org]
Sent: 08 December 2017 15:11
To: Commons Users List <***@commons.apache.org>
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
commons-dbcp2-2.1.1.jar
commons-pool2-2.4.3.jar
Set the jmxName property on your BasicDataSourceFcatory and that will enable JMX for DBCP and the underlying pools.



Mark
Post by Walter Heestermans (TME)
Walter
-----Original Message-----
Sent: 08 December 2017 13:58
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
Hi,
We have Struts application using the commons DBCP and commons Pool implementation. I like to have the pool information exposed as JMX beans, so that I can use JConsole to look a t the pool behaviour. The application is deployed inside a Jetty container. I can see a lot of info already via JConsole but the pool information is missing.
What is required to be able to do that?
A good place to start would be you telling the list which versions of Commons DBCP and Commons Pool are being used.
Mark
---------------------------------------------------------------------
This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.
---------------------------------------------------------------------
---------------------------------------------------------------------

To unsubscribe, e-mail: user-***@commons.apache.org<mailto:user-***@commons.apache.org>

For additional commands, e-mail: user-***@commons.apache.org<mailto:user-***@commons.apache.org>



This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.
Mark Thomas
2017-12-08 15:22:43 UTC
Permalink
Post by Walter Heestermans (TME)
This is what has been coded by the project
I've confirmed that the name used is valid.

You won't see anything in JMX until BasicDataSource.createDataSource()
is called. Typically, you'd trigger that with a call to getConnection().

I used TestBasicDataSource#testClose() to confirm everything was working
as expected. I recommended comparing your code to that test case to see
where it differs.

Mark
Post by Walter Heestermans (TME)
 

 
    public static void setUp() throws Exception {
        // Load JDBC Driver class.
        Class.forName(DatabaseProperties.DB_DRIVER).newInstance();
 
*      connectionPool = new BasicDataSource();*
 
        connectionPool.setUsername(DatabaseProperties.DB_USER);
        connectionPool.setPassword(DatabaseProperties.DB_PASSWORD);
        connectionPool.setDriverClassName(DatabaseProperties.DB_DRIVER);
        connectionPool.setUrl(DatabaseProperties.DB_URL);
        connectionPool.setInitialSize(0);
       
connectionPool.setValidationQuery(DatabaseProperties.DB_PREFERRED_TEST_QUERY);
        connectionPool.setMaxIdle(DatabaseProperties.DB_MAX_IDLE);
        connectionPool.setMinIdle(DatabaseProperties.DB_MIN_IDLE);
       
//connectionPool.setMaxActive(Integer.parseInt(DatabaseProperties.DB_MAX_POOL_SIZE));
       
connectionPool.setMinEvictableIdleTimeMillis(DatabaseProperties.DB_MIN_EVICTABLE_IDLE_TME_MILIS);
*      connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*
 

 
Nothing in jconsole
 
 
Maybe related to the name they use?
 
*connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*
 
Walter
 
 
-----Original Message-----
Sent: 08 December 2017 15:11
Subject: Re: [dbcp] Exposing JMXbeans
 
Post by Walter Heestermans (TME)
commons-dbcp2-2.1.1.jar
commons-pool2-2.4.3.jar
 
Set the jmxName property on your BasicDataSourceFcatory and that will
enable JMX for DBCP and the underlying pools.
 
Mark
 
Post by Walter Heestermans (TME)
Walter
-----Original Message-----
Sent: 08 December 2017 13:58
Subject: Re: [dbcp] Exposing JMXbeans
Hi,
 
We have Struts application using  the commons DBCP and commons Pool
implementation. I like to have the pool information exposed as JMX
beans, so that I can use JConsole to look a t the pool behaviour. The
application is deployed inside a Jetty container. I can see a lot of
info already via JConsole but the pool information is missing.
Post by Walter Heestermans (TME)
 
What is required to be able to do that?
A good place to start would be you telling the list which versions of
Commons DBCP and Commons Pool are being used.
Post by Walter Heestermans (TME)
Mark
---------------------------------------------------------------------
This e-mail may contain confidential information. If you are not an
addressee or otherwise authorised to receive this message, you should
not use, copy, disclose or take any action based on this e-mail. If you
have received this e-mail in error, please inform the sender promptly
and delete this message and any attachments immediately.
Post by Walter Heestermans (TME)
---------------------------------------------------------------------
 
 
---------------------------------------------------------------------
 
This e-mail may contain confidential information. If you are not an
addressee or otherwise authorised to receive this message, you should
not use, copy, disclose or take any action based on this e-mail. If you
have received this e-mail in error, please inform the sender promptly
and delete this message and any attachments immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Walter Heestermans (TME)
2017-12-08 15:29:29 UTC
Permalink
Project has changed the name to



connectionPool.setJmxName("org.apache.commons.dbcp2:DataSource=ECIDB");



(old: connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*)



and now info is given in jconsole



Walter





-----Original Message-----
From: Mark Thomas [mailto:***@apache.org]
Sent: 08 December 2017 16:23
To: ***@commons.apache.org
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
This is what has been coded by the project
I've confirmed that the name used is valid.



You won't see anything in JMX until BasicDataSource.createDataSource()

is called. Typically, you'd trigger that with a call to getConnection().



I used TestBasicDataSource#testClose() to confirm everything was working as expected. I recommended comparing your code to that test case to see where it differs.



Mark
Post by Walter Heestermans (TME)


public static void setUp() throws Exception {
// Load JDBC Driver class.
Class.forName(DatabaseProperties.DB_DRIVER).newInstance();
* connectionPool = new BasicDataSource();*
connectionPool.setUsername(DatabaseProperties.DB_USER);
connectionPool.setPassword(DatabaseProperties.DB_PASSWORD);
connectionPool.setDriverClassName(DatabaseProperties.DB_DRIVER);
connectionPool.setUrl(DatabaseProperties.DB_URL);
connectionPool.setInitialSize(0);
connectionPool.setValidationQuery(DatabaseProperties.DB_PREFERRED_TEST
_QUERY);
connectionPool.setMaxIdle(DatabaseProperties.DB_MAX_IDLE);
connectionPool.setMinIdle(DatabaseProperties.DB_MIN_IDLE);
//connectionPool.setMaxActive(Integer.parseInt(DatabaseProperties.DB_M
AX_POOL_SIZE));
connectionPool.setMinEvictableIdleTimeMillis(DatabaseProperties.DB_MIN
_EVICTABLE_IDLE_TME_MILIS);
* connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*


Nothing in jconsole
Maybe related to the name they use?
*connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*
Walter
-----Original Message-----
Sent: 08 December 2017 15:11
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
commons-dbcp2-2.1.1.jar
commons-pool2-2.4.3.jar
Set the jmxName property on your BasicDataSourceFcatory and that will
enable JMX for DBCP and the underlying pools.
Mark
Post by Walter Heestermans (TME)
Walter
-----Original Message-----
Sent: 08 December 2017 13:58
Subject: Re: [dbcp] Exposing JMXbeans
Post by Walter Heestermans (TME)
Hi,
We have Struts application using the commons DBCP and commons Pool
implementation. I like to have the pool information exposed as JMX
beans, so that I can use JConsole to look a t the pool behaviour. The
application is deployed inside a Jetty container. I can see a lot of
info already via JConsole but the pool information is missing.
Post by Walter Heestermans (TME)
Post by Walter Heestermans (TME)
What is required to be able to do that?
A good place to start would be you telling the list which versions of
Commons DBCP and Commons Pool are being used.
Post by Walter Heestermans (TME)
Mark
---------------------------------------------------------------------
This e-mail may contain confidential information. If you are not an
addressee or otherwise authorised to receive this message, you should
not use, copy, disclose or take any action based on this e-mail. If
you have received this e-mail in error, please inform the sender
promptly and delete this message and any attachments immediately.
Post by Walter Heestermans (TME)
---------------------------------------------------------------------
---------------------------------------------------------------------
This e-mail may contain confidential information. If you are not an
addressee or otherwise authorised to receive this message, you should
not use, copy, disclose or take any action based on this e-mail. If
you have received this e-mail in error, please inform the sender
promptly and delete this message and any attachments immediately.
---------------------------------------------------------------------

To unsubscribe, e-mail: user-***@commons.apache.org<mailto:user-***@commons.apache.org>

For additional commands, e-mail: user-***@commons.apache.org<mailto:user-***@commons.apache.org>



This e-mail may contain confidential information. If you are not an addressee or otherwise authorised to receive this message, you should not use, copy, disclose or take any action based on this e-mail. If you have received this e-mail in error, please inform the sender promptly and delete this message and any attachments immediately.
Loading...