[dbcp] Exposing JMXbeans

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[dbcp] Exposing JMXbeans

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?

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.
Reply | Threaded
Open this post in threaded view
|

Re: [dbcp] Exposing JMXbeans

Mark Thomas
On 08/12/17 12:47, Walter Heestermans (TME) wrote:
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [dbcp] Exposing JMXbeans

Walter Heestermans (TME)
We are using:

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

Walter


-----Original Message-----
From: Mark Thomas [mailto:[hidden email]]
Sent: 08 December 2017 13:58
To: [hidden email]
Subject: Re: [dbcp] Exposing JMXbeans

On 08/12/17 12:47, Walter Heestermans (TME) wrote:
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [dbcp] Exposing JMXbeans

Mark Thomas
On 08/12/17 12:59, Walter Heestermans (TME) wrote:
> We are using:
>
> 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

>
> Walter
>
>
> -----Original Message-----
> From: Mark Thomas [mailto:[hidden email]]
> Sent: 08 December 2017 13:58
> To: [hidden email]
> Subject: Re: [dbcp] Exposing JMXbeans
>
> On 08/12/17 12:47, Walter Heestermans (TME) wrote:
>> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [dbcp] Exposing JMXbeans

Walter Heestermans (TME)

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

 

 

Maybe related to the name they use?

 

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

 

Walter

 

 

-----Original Message-----
From: Mark Thomas [mailto:[hidden email]]
Sent: 08 December 2017 15:11
To: Commons Users List <[hidden email]>
Subject: Re: [dbcp] Exposing JMXbeans

 

On 08/12/17 12:59, Walter Heestermans (TME) wrote:

> We are using:

>

> 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

 

>

> Walter

>

>

> -----Original Message-----

> From: Mark Thomas [[hidden email]]

> Sent: 08 December 2017 13:58

> To: [hidden email]

> Subject: Re: [dbcp] Exposing JMXbeans

>

> On 08/12/17 12:47, Walter Heestermans (TME) wrote:

>> 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: [hidden email]

> For additional commands, e-mail: [hidden email]

>

> 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: [hidden email]

> For additional commands, e-mail: [hidden email]

>

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]

 

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.

Reply | Threaded
Open this post in threaded view
|

Re: [dbcp] Exposing JMXbeans

Mark Thomas
On 08/12/17 14:28, Walter Heestermans (TME) wrote:
> 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


>
>  
>
> …
>
>  
>
>     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-----
> From: Mark Thomas [mailto:[hidden email]]
> Sent: 08 December 2017 15:11
> To: Commons Users List <[hidden email]>
> Subject: Re: [dbcp] Exposing JMXbeans
>
>  
>
> On 08/12/17 12:59, Walter Heestermans (TME) wrote:
>
>> We are using:
>
>>
>
>> 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
>
>  
>
>>
>
>> Walter
>
>>
>
>>
>
>> -----Original Message-----
>
>> From: Mark Thomas [mailto:[hidden email]]
>
>> Sent: 08 December 2017 13:58
>
>> To: [hidden email] <mailto:[hidden email]>
>
>> Subject: Re: [dbcp] Exposing JMXbeans
>
>>
>
>> On 08/12/17 12:47, Walter Heestermans (TME) wrote:
>
>>> 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: [hidden email]
> <mailto:[hidden email]>
>
>> For additional commands, e-mail: [hidden email]
> <mailto:[hidden email]>
>
>>
>
>> 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: [hidden email]
> <mailto:[hidden email]>
>
>> For additional commands, e-mail: [hidden email]
> <mailto:[hidden email]>
>
>>
>
>  
>
>  
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: [hidden email]
> <mailto:[hidden email]>
>
> For additional commands, e-mail: [hidden email]
> <mailto:[hidden email]>
>
>  
>
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [dbcp] Exposing JMXbeans

Walter Heestermans (TME)
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:[hidden email]]
Sent: 08 December 2017 16:23
To: [hidden email]
Subject: Re: [dbcp] Exposing JMXbeans



On 08/12/17 14:28, Walter Heestermans (TME) wrote:

> 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





>

>

>

> …

>

>

>

>     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-----

> From: Mark Thomas [mailto:[hidden email]]

> Sent: 08 December 2017 15:11

> To: Commons Users List <[hidden email]<mailto:[hidden email]>>

> Subject: Re: [dbcp] Exposing JMXbeans

>

>

>

> On 08/12/17 12:59, Walter Heestermans (TME) wrote:

>

>> We are using:

>

>>

>

>> 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

>

>

>

>>

>

>> Walter

>

>>

>

>>

>

>> -----Original Message-----

>

>> From: Mark Thomas [mailto:[hidden email]]

>

>> Sent: 08 December 2017 13:58

>

>> To: [hidden email]<mailto:[hidden email]> <mailto:[hidden email]>

>

>> Subject: Re: [dbcp] Exposing JMXbeans

>

>>

>

>> On 08/12/17 12:47, Walter Heestermans (TME) wrote:

>

>>> 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: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

>> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

>>

>

>> 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: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

>> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

>>

>

>

>

>

>

> ---------------------------------------------------------------------

>

> To unsubscribe, e-mail: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>

> <mailto:[hidden email]>

>

>

>

> 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: [hidden email]<mailto:[hidden email]>

For additional commands, e-mail: [hidden email]<mailto:[hidden email]>



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.