commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Essl <>
Subject Re: [Hivemind] Question about customized ClassResolvers
Date Wed, 10 Mar 2004 10:15:33 GMT
Hi John,

I like your multimodule classloader. I think HiveMind needs something like 

I was just wondering wheter the properties file is needed. I thought 
wheter it was possible to load all META-INF/hivemodule.xml and than parse 
the loaded ModuleDescriptors for contributions to a 'magic' config-point - 
ie 'hivemind.load-additional'. The contributions specify which additinal 
modules should be loaded.

I think this would not only save you an extra file but could also give 
runtime reflection about which modules are loaded from where.


On Wed, 10 Mar 2004 04:34:05 -0500 (EST), John Rubier 
<> wrote:

> Hey Geoff,
> It may have something to do with HiveMind passing the path (hard coded) 
> "META-INF/hivemodule.xml". I think depending on how your project is set 
> up and/or what classloaders are involved, it may want /META-INF or who 
> knows. Just a guess.
> You might give that multimodule classloader I posted a few days back a 
> try as you can specify paths to the hivemodule.xml files in a properties 
> file. Now whether it will pick up the props file itself is a different 
> story :)
> I also haven't tried it under jetty/whatever...YMMV
> Take care,
> John
> On Wednesday March 10th 2004, Geoff Longman wrote:
>> Hey, I have tweaked up my own version of HiveMindFilter's init() method
>> because I want to run a junit test in Eclipse and have the Registry 
>> pick up
>> my as yet notjarred hivemodule.xml
>> Having looked at TestRegistryBuilder, it appears that this should work:
>> // want to pick up META-INF/hivemodule.xml in the project root
>> File f = new File("");
>> URL[] urls = new URL[] { f.toURL()};
>> ClassLoader loader =
>> new URLClassLoader(urls,
>> Thread.currentThread().getContextClassLoader());
>> ClassResolver resolver = new DefaultClassResolver(loader);
>> // end of Tweak
>> RegistryBuilder builder = new RegistryBuilder();
>> builder.processModules(resolver);
>> _registry = builder.constructRegistry(getRegistryLocale());
>> When checking the URL from the File in the debugger it looks right, 
>> i.e. the
>> URL refers to the root of my project.
>> But, I get the following error:
>> org.apache.hivemind.ApplicationRuntimeException: Registry does not 
>> contain
>> module 'com.iw.session.local'.
>> ^^^ the name of the module I have constructed.
>> Even stranger, if I leave the code above as is and force the Eclipse 
>> junit
>> test launch config classpath to contain the project root folder, 
>> everything
>> works - green lights across the board..
>> I'm not really that up on these classloader tricks. Does anyone see
>> something here?
>> Geoff
>> Geoffrey Longman
>> Intelligent Works Inc.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Christian Essl 

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

View raw message