You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Yong Gou <yg...@bea.com> on 2006/01/16 08:28:33 UTC

cannot get correct attributes and operations from the Data Source mbean created through jconsole GUI

Hi,

 

Can anyone who has experienced the following problem tell me how to
solve it when creating DataSource mbean on the JMX server of Tomcat
server 5.5.12?

The problem I encountered can be described like this: I used JDK1.5's
jconsole utility to connect to my Tomcat server, after it was connected
I invoked the method void addResource("ds_123", "javax.sql.DataSource")
on the mbean "Catalina:type=NamingResources,resourcetype=Global" to add
a DataSource mbean to the JMX server. This operation should have created
a "Catalina:type=DataSource,class=javax.sql.DataSource,name="ds_123""
mbean with attributes such as username, password, url and with methods
like getConnection, close. But actually the created mbean which only has
attributes like factoryClassName, factoryClassLocation, className and
has methods like remove clear and clone was quite different than the
correct mbean I expected. But with Tomcat admin console webapp, I could
create the DataSource mbean I expected correctly. In my understanding,
these two methods should generate the same result but the truth was not.
I checked some related source code of tomcat admin console webapp such
as SaveDataSourceAction.java but didn't find any clue to get the correct
answer.

Acutally I got the same result like what I got using jconsole when I
invoked method void addResource("ds_123", "javax.sql.DataSource") on the
mbean "Catalina:type=NamingResources,resourcetype=Global" in a java
program. How can I create a DataSource mbean with the correct attributes
and methods like the mbean created using Tomcat admin console webapp.

 

Thank you in advance!

 

Eric