You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Diego Barreto <di...@gmail.com> on 2012/09/15 04:24:10 UTC

@Inject Error

Hi,

I know that i'm doing something wrong, but I don't know what!

I'm just trying to inject a simple class (Facade for my BO's) in a page,
like:

@inject
private Facade facade;

In my Facade I receive an BO implementation with inject too:

@Inject
private ImplBO implBO;

This code works in other project, but the other project is not using
Tapestry and it uses other CDI implementation too.

All of @Inject is pointing to: org.apache.tapestry5.ioc.annotations.Inject

I have to anotate the classes with something or implement some interface ?

Thanks

Diego Barreto

Re: @Inject Error

Posted by Muhammad Gelbana <m....@gmail.com>.
I'm sorry but how is the other project working if it's not using Tapestry
while the @Inject annotations are Tapestry's ?


On Sat, Sep 15, 2012 at 4:43 AM, Taha Siddiqi <ta...@gmail.com>wrote:

> Hi
>
> Are you binding your service in the Module class ?
>
> public static void bind(ServiceBinder binder){
>    binder.bind(Facade.class, FacadeImpl.class); //In case it is an
> interface/impl
>    binder.bind(ImplBO.class) // In case it is a class
> }
>
> regards
> Taha
>
> On Sep 15, 2012, at 7:54 AM, Diego Barreto wrote:
>
> > Hi,
> >
> > I know that i'm doing something wrong, but I don't know what!
> >
> > I'm just trying to inject a simple class (Facade for my BO's) in a page,
> > like:
> >
> > @inject
> > private Facade facade;
> >
> > In my Facade I receive an BO implementation with inject too:
> >
> > @Inject
> > private ImplBO implBO;
> >
> > This code works in other project, but the other project is not using
> > Tapestry and it uses other CDI implementation too.
> >
> > All of @Inject is pointing to:
> org.apache.tapestry5.ioc.annotations.Inject
> >
> > I have to anotate the classes with something or implement some interface
> ?
> >
> > Thanks
> >
> > Diego Barreto
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: @Inject Error

Posted by Taha Siddiqi <ta...@gmail.com>.
Hi

Are you binding your service in the Module class ?

public static void bind(ServiceBinder binder){
   binder.bind(Facade.class, FacadeImpl.class); //In case it is an interface/impl
   binder.bind(ImplBO.class) // In case it is a class
}

regards
Taha

On Sep 15, 2012, at 7:54 AM, Diego Barreto wrote:

> Hi,
> 
> I know that i'm doing something wrong, but I don't know what!
> 
> I'm just trying to inject a simple class (Facade for my BO's) in a page,
> like:
> 
> @inject
> private Facade facade;
> 
> In my Facade I receive an BO implementation with inject too:
> 
> @Inject
> private ImplBO implBO;
> 
> This code works in other project, but the other project is not using
> Tapestry and it uses other CDI implementation too.
> 
> All of @Inject is pointing to: org.apache.tapestry5.ioc.annotations.Inject
> 
> I have to anotate the classes with something or implement some interface ?
> 
> Thanks
> 
> Diego Barreto


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org