views:

1188

answers:

1

Hi,

We are using JDeveloper 11g. Both a Model and ViewController project that makes use of ADF fusion and what not.

My web-xml has an ejb reference for a statfull session ejb. I have a managedbean that's declared in faces-config.

I am trying to access a EJb from inside the managed bean.

I declare @EJB (name ="LocationServicesEJB") private LocationServicesEJB locationServices;

When accessing this in a method, the locationServices is null. I dont not see any jndi type problems in the console, so I imagine that it's not even bothering to lookup.

Do I need to enable injection or something? Or do I need to define 'locationServices' as managed property in my faces-config?

Please advise. Thanx

+1  A: 

You are confusing two different types of injection.

  1. There is EJB injection that happens among EJBs by the respective annotation. This type is handled by the EJB container (your application server or OpenEJB e.t.c)

  2. Then there is "normal" injection (ala Spring) that happens between normal Java beans and is defined in faces-config. This type is handled by JSF.

So decide what you want to do.

My proposal would be to download the official Java EE tutorial and skim through all topics.

kazanaki
thanx and sorry for only replying now.But yes you are right.I'll consider the tutorial... it's the adf stuff that's killing me