Here's the issue: if there is no @Constructor annotation, it
currently attempts to heuristically determine the params, ignoring
@Autowire. I should probably make the heuristic processor be smarter
and understand this. In the meantime, can you put @Constructor (no
name attribute) on the class?
Jim
On Jul 15, 2006, at 8:16 AM, Jeremy Boynes wrote:
I have a problem with ComponentLoader - when I use:
public ComponentLoader(@Autowire LoaderRegistry registry,
@Autowire StAXPropertyFactory
propertyFactory) {
}
I get:
testBoot2Deployment
(org.apache.tuscany.core.deployer.BootstrapDeployerTestCase) Time
elapsed: 0.07 sec <<< ERROR!
org.apache.tuscany.core.implementation.processor.AmbiguousConstructorE
xception: org.apache.tuscany.spi.loader.StAXPropertyFactory
at
org.apache.tuscany.core.implementation.processor.HeuristicPojoProcesso
r.calcConstructor(HeuristicPojoProcessor.java:186)
at
org.apache.tuscany.core.implementation.processor.HeuristicPojoProcesso
r.visitEnd(HeuristicPojoProcessor.java:136)
at
org.apache.tuscany.core.implementation.IntrospectionRegistryImpl.intro
spect(IntrospectionRegistryImpl.java:106)
at
org.apache.tuscany.core.implementation.system.loader.SystemComponentTy
peLoader.loadByIntrospection(SystemComponentTypeLoader.java:82)
...
Any ideas?
--
Jeremy
On Jul 14, 2006, at 10:12 PM, Jim Marino wrote:
I've checked in support for constructor-based autowiring. System
components can now do the following:
private static class FooImpl implements Foo {
private Bar ref;
public FooImpl(@Autowire Bar ref) {
this.ref = ref;
}
}
When creating FooImpl, the runtime will pass an autowired Bar to
the constructor.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]