tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme BATON <>
Subject Adding DataSources to a specific webapp context using MBeanServer
Date Mon, 11 Oct 2004 17:55:16 GMT

Hi all,

My goal is to dynamically add DataSources to the context of a specific webapp.

To do this, I wrote a struts plugin which reads a properties file. 

I've looked at the admin webapp for the JMX/MBeanServer code, I used the code in class SaveDataSourceAction.
And it works fine _only if_ I choose "Global" (ResourceUtils.GLOBAL_TYPE) as parameter and
not when I use "Context" (ResourceUtils.CONTEXT_TYPE) in the following code fragment.

oname = new ObjectName( domain + ResourceUtils.RESOURCE_TYPE + ResourceUtils.GLOBAL_TYPE +
",class=" + params[1] + 
                                            ",name=" + params[0]);

I used the same parameters as those seen from the running admin webapp but I get a MBeanServer cannot find MBean 
with ObjectName Catalina:type=NamingResources,resourcetype=Context,path=/struts-arch,host=localhost
        at mx4j.server.MBeanServerImpl.findMBeanMetaData(
        at mx4j.server.MBeanServerImpl.invoke(
        at igc.arch.action.plugin.DBPropertiesToContextPlugin.ajouteDataSource(
        at igc.arch.action.plugin.DBPropertiesToContextPlugin.init(
        at org.apache.struts.action.ActionServlet.initModulePlugIns(

I run Tomcat 5.0. on an xp pro box

Thanks a lot 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message