commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Rubier <>
Subject Re: [Hivemind] Question about customized ClassResolvers
Date Wed, 10 Mar 2004 09:34:05 GMT
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,


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:

View raw message