tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme BATON <>
Subject RE: Adding DataSources to a specific webapp context using MBeanServer - half success
Date Tue, 12 Oct 2004 08:01:24 GMT
Hi all,

Could anyone tell me the order of the initializations of the webapps contexts, the webapps,
the servlets (those run at startup).

I succeeded in creating my DataSources in my webapp context by redeploying my classes with
tomcat running, I just copied the newly compiled 
classes to the WEB-INF/classes directory, and tada! The datasources appeared in the admin
It works but the problem is not solved as I did it by hand.

I'll explore the way of making it recompiled automatically by another webapp which name alphabetically
follows my webapp's name and is therefore deployed after.
But I would prefer a less dirty way.

Thanks for your help


-----Message d'origine-----
De : Jérôme BATON 
Envoyé : lundi 11 octobre 2004 19:55
À :
Objet : Adding DataSources to a specific webapp context using MBeanServer

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