Your code is only loading your one specific descriptor; you still need
to use the normal process for loading descriptors on the classpath,
such as the built-in ones for the hivemind module itself.

HiveMind isn't as smart as PicoContainer at autowriing w/
constructors; for constuctor DI you must supply a list of constructor
arguments, no autowiring.


On Tue, 12 Oct 2004 21:57:34 +0800, Alistair Israel <[EMAIL PROTECTED]> wrote:
> Hi, folks!
> 
> Apologies if this has been asked and answered before. I've only worked
> with Hivemind for about a week or so and have managed to get it to
> work very basically for me - I still don't know whether the Registry
> can 'autowire' using constructor injection like it can with setter
> injection (or like how Picocontainer does it).
> 
> Anyway, so now I'm trying to specify the location of "hivemodule.xml"
> myself, someplace (possibly) not in $user.dir\META-INF or someplace
> outside of the classpath perhaps.
> 
> I already have the following code to bootstrap the registry.
>         ClassResolver classResolver = new DefaultClassResolver();
>         ModuleDescriptor moduleDescriptor = new ModuleDescriptor();
>         moduleDescriptor.setLocation(new LocationImpl(new
> FileResource( "C:\\hivemodule.xml")));
>         RegistryBuilder registryBuilder = new RegistryBuilder();
>         registryBuilder.processModule(moduleDescriptor);
>         registry = registryBuilder.constructRegistry(Locale.getDefault());
> 
> I've also tried the alternate method of constructing the Registry at:
> http://article.gmane.org/gmane.comp.jakarta.hivemind.user/219
> 
> When I run the (unit test code), I get the following exception:
> 
> java.lang.ExceptionInInitializerError
>         at 
> test.enterworks.epim.spike.MigrationComponentBuilderTest.testGetDbProxy(MigrationComponentBuilderTest.java:53)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:127)
>         at junit.framework.TestResult$1.protect(TestResult.java:106)
>         at junit.framework.TestResult.runProtected(TestResult.java:124)
>         at junit.framework.TestResult.run(TestResult.java:109)
>         at junit.framework.TestCase.run(TestCase.java:118)
>         at junit.framework.TestSuite.runTest(TestSuite.java:208)
>         at junit.framework.TestSuite.run(TestSuite.java:203)
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> Caused by: org.apache.hivemind.ApplicationRuntimeException: Service
> point hivemind.Startup does not exist.
>         at 
> org.apache.hivemind.impl.RegistryImpl.getServicePoint(RegistryImpl.java:142)
>         at 
> org.apache.hivemind.impl.RegistryImpl.getService(RegistryImpl.java:149)
>         at 
> org.apache.hivemind.impl.RegistryImpl.startup(RegistryImpl.java:321)
>         at 
> org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:417)
>         at 
> com.enterworks.epim.spike.MigrationComponentBuilder.<clinit>(MigrationComponentBuilder.java:41)
>         ... 16 more
> 
> I must be missing something very, very basic, I know - but for the
> life of me can't see it in the docs (which, BTW it seems they now
> refer to 1.1alpha so they're not very useful).
> 
> TIA!
> 
> Alistair A. Israel
> --
> http://aisrael.multiply.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to