hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Zimmermann" <zet4...@gmx.de>
Subject Error using annotated module
Date Tue, 03 Apr 2007 17:48:11 GMT
Hello!

I'm trying to use the annotated module notation.

It works, when I use the following code:

AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
   TypedRegistry registry = builder.constructRegistry(CalculatorModule.class, TestModule.class);
        
Calculator calculator = registry.getService(Calculator.class);

Trying the second example from the wiki does not work.

RegistryDefinition registryDefinition = new RegistryDefinition();

AnnotatedModuleReader reader = new AnnotatedModuleReader(registryDefinition);
reader.readModule(org.apache.hivemind.SimpleModule.class);

RegistryBuilder builder = new RegistryBuilder(registryDefinition );
Registry registry = builder.constructRegistry();

First point:
RegistryDefinition registryDefinition = new RegistryDefinition();

This line does not work, I changed it to 
RegistryDefinition registryDefinition = new RegistryDefinitionImpl();
because it says cannot instantiate type RegistryDefinition.

Using this code results in the following error:

Exception in thread "main" java.lang.StackOverflowError
at org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:130)

at org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:130)

at org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:130)

I do not use exactly the example code but a little app of my own.

Again, the first example works fine, only the second one does not work.

Is this an error in the alpha release or am I doing something wrong (with my changed line)?

Thanks!!

Regards,
Jochen Zimmermann



Mime
View raw message