quality@glassfish.java.net

Re: Order of injection for EJB's

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Tue, 19 Jan 2010 09:26:04 +0100

Hi Richard,


Sorry, I have no idea what's going wrong in your code. I'm not sure if
you're allowed to inject Stateless Session beans into Stateless Session
beans, but I don't see why not.

Anyway, I guess you know but I still wanted to say this. With EJB 3.1
you're no longer required to implement interfaces in your local session
beans. So you can rewrite your classes like this and it still should
work

@Stateless
public class AFacade {
}

public class BFacade {
    @EJB
    private AFacade aFacade;
}


HTH, Wouter

On Tue, Jan 19, 2010 at 09:45:11AM +0200, Richard Kolb wrote:
> Hi Cats.
>
> I have a problem deploying my EJB application on GlassFish 3.
> I'm using EJB's much more heavily now.
>
>
>
> A very simplified version of my application is.
> @Stateless
> public class AFacade implements AFacadeLocal {
> }
>
> then
> public class BFacade implements BFacadeLocal {
> @EJB
> private AFacadeLocal aFacade;
>
> }
>
> java.ejb.DependsOn is for Singletons
> java.ejb.Dependent is maybe what I should use ? But I am not sure how.
>
>
> Sometime the EJB deploys and sometimes not. - Because it can't find AFacade
> Is that correct in terms of GlassFish 3?
>
> regards
> Richard.
>

-- 
Lime and limpid green a second scene,
A fight between the blue you once knew.
Floating down the sound resounds
Around the icy waters underground
[Pink Floyd - Astronomy Domine]
Skype: wvreeven
Facebook: wvreeven
Twitter: wvreeven