You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Marcus Bond <ma...@devasoftware.co.uk> on 2014/11/03 09:00:08 UTC

Re: Blueprint bean error on startup

Thanks all, problem solved, initially constructor wasn't there but even
when it era correct my actual problem was that of using stale snapshots.

On Friday, October 31, 2014, Sten Roger Sandvik <sr...@enonic.com> wrote:

>
> Seems to me that you have the opposite in your bean declaration. "FooImpl
> has a constructor with a single argument takning the Bar interface".
>
> ------------------------------
> *From: *"Freeman Fang" <freeman.fang@gmail.com
> <javascript:_e(%7B%7D,'cvml','freeman.fang@gmail.com');>>
> *To: *user@karaf.apache.org
> <javascript:_e(%7B%7D,'cvml','user@karaf.apache.org');>
> *Sent: *Friday, October 31, 2014 3:44:05 AM
> *Subject: *Re: Blueprint bean error on startup
>
> Hi,
>
> Are you sure "BarImpl has a constructor with a single argument taking the
> Foo interface", your blueprint file doesn't match this.
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
>
>
>
> On 2014-10-30, at 下午4:32, Marcus Bond wrote:
>
> Hi,
>
> I have the following beans declared in a blueprint config and I am having
> receiving
> error org.osgi.service.blueprint.container.ComponentDefinitionException:
> Unable to find a matching constructor on class uk.co.marcusbond.FooImpl for
> arguments
> [org.apache.aries.blueprint.container.BeanRecipe$UnwrapperedBeanHolder@169e5808
> ]
>
>
> <bean class="uk.co.marcusbond.BarImpl" id="bar" />
>
> <bean class="uk.co.marcusbond.FooImpl" id="foo">
>     <argument ref="bar" />
> </bean>
>
> FooImpl implements interface Foo and BarImpl has a constructor with a
> single argument taking the Foo interface (dependency on interface not
> implementation) yet I get the above error and when listed the feature /
> bundle is shown in state Failure.
> Another oddity is that this only happens on karaf startup, if I add a
> bundle:watch and then rebuild the relevant bundle exactly the same the
> change is picked up and the bundle installed correctly (Active). Is this a
> bug or a problem with the configuration?
>
> Regards,
> Marcus.
>
>
>
>