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:[email protected]]
> Sent: 08 December 2017 15:11
> To: Commons Users List <[email protected]>
> 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:[email protected]]
> 
>> Sent: 08 December 2017 13:58
> 
>> To: [email protected] <mailto:[email protected]>
> 
>> 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: [email protected]
> <mailto:[email protected]>
> 
>> For additional commands, e-mail: [email protected]
> <mailto:[email protected]>
> 
>>
> 
>> 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: [email protected]
> <mailto:[email protected]>
> 
>> For additional commands, e-mail: [email protected]
> <mailto:[email protected]>
> 
>>
> 
>  
> 
>  
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: [email protected]
> <mailto:[email protected]>
> 
> For additional commands, e-mail: [email protected]
> <mailto:[email protected]>
> 
>  
> 
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to