I tried to inject a stateless session bean into the
JSF managed bean using netbeans 6.1+glassfish v2.
First I create an enterprise application with an
ejb module and a web module,then create a Remote stateless session bean in the ejb module,and add a business method.
Next I add JSF Framework to the web module and add a
java class and using netbeans context menu to config it as the managed bean in the face-config.xml,then I open the managed bean class and select context menu :enterprise resource->call enterprise bean and select the session bean I created. After that these two lines add to the file
but when I use the managed bean , I found the testBean is null.
I have search the web and found some usage(DI) like this,
Are there something wrong with what I'm doing?
ps:I know the Seam framework and the jndi lookup can fix it,
but here I just want to know why can't I inject ejb into my managed bean?