You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Arnaud Yahoo <a_...@yahoo.fr.INVALID> on 2019/02/04 10:30:36 UTC
Create a JNDI Datasource through JMX
Hello,
I would like to know if it is possible to create/configure a Datasource
Ressource in tomcat using JMX.
I tried with a tomcat 8.5 and jconsole, I managed to create some
resource with type javax.sql.Datasource, but I did not find a way to
configure the datasource (jdbc driver, url, max active, ...)
It seems hard to find informations about that.
Thanks,
Arnaud
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Create a JNDI Datasource through JMX
Posted by Arnaud Yahoo <a_...@yahoo.fr.INVALID>.
Hello Luis,
thanks for your answer.
Connection pool exposes an MBean (jmxEnabled is true by default).
Using jconsole, I can see pool defined in server configuration or
context configuration, but I cannot see neither change properties of
existing pool (maxActive for example).
Of course I could register a MBean wrapping the datasource, but I'd
prefer to know if it is already possible to avoid to "reinvent the
wheel", if tomcat is providing such feature.
My goal is to be able to create/configure a datasource dynamically on a
running tomcat instance (using JMX Proxy Servlet and curl for example)
Arnaud
On 04/02/2019 15:30, Luis Rodríguez Fernández wrote:
> Hello Arnaud,
>
> mmm, nothing stops you from create your custom mbean interface that wraps
> your datasource.
>
> From Tomcat 8.5 doc "The connection pool object exposes an MBean that can
> be registered" [1] Perhaps you could start having a look here. Nevertheless
> may I ask you what is your use case for this?
>
> Hope it helps,
>
> Luis
>
>
> [1] https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html#JMX
>
>
>
>
>
>
> El lun., 4 feb. 2019 a las 11:30, Arnaud Yahoo (<a_...@yahoo.fr.invalid>)
> escribió:
>
>> Hello,
>>
>> I would like to know if it is possible to create/configure a Datasource
>> Ressource in tomcat using JMX.
>>
>> I tried with a tomcat 8.5 and jconsole, I managed to create some
>> resource with type javax.sql.Datasource, but I did not find a way to
>> configure the datasource (jdbc driver, url, max active, ...)
>>
>> It seems hard to find informations about that.
>>
>> Thanks,
>>
>> Arnaud
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Create a JNDI Datasource through JMX
Posted by Luis Rodríguez Fernández <uo...@gmail.com>.
Hello Arnaud,
mmm, nothing stops you from create your custom mbean interface that wraps
your datasource.
From Tomcat 8.5 doc "The connection pool object exposes an MBean that can
be registered" [1] Perhaps you could start having a look here. Nevertheless
may I ask you what is your use case for this?
Hope it helps,
Luis
[1] https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html#JMX
El lun., 4 feb. 2019 a las 11:30, Arnaud Yahoo (<a_...@yahoo.fr.invalid>)
escribió:
> Hello,
>
> I would like to know if it is possible to create/configure a Datasource
> Ressource in tomcat using JMX.
>
> I tried with a tomcat 8.5 and jconsole, I managed to create some
> resource with type javax.sql.Datasource, but I did not find a way to
> configure the datasource (jdbc driver, url, max active, ...)
>
> It seems hard to find informations about that.
>
> Thanks,
>
> Arnaud
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
- Samuel Beckett