I actually have problem with the annotation @EJB both with local and remote use. But in this question I would like to focus on the local use.
In this experiment I use Jboss EAP 6.4.
In the image below I try to show my EAR-structure and where the problem occurs, the red arrow.
My code in LocalCallSessionBean that should be injected looks like:
@EJB(mappedName="StatelessBean")
private static BeanLocal beanLocal;
public static String returnAString(String parameter)
{
try
{
String string_2 = beanLocal.returnAString("LocalCallsBean-no-interface");
My problem is that beanLocal never get injected and I get a NullPointer at the last row above.
According to: https://docs.oracle.com/javaee/6/tutorial/doc/gipjf.html#girfl ...under section "Accessing Local Enterprise Beans That Implement Business Interfaces" I think this should work.
Do you guys see something that I have missed? Best regards Fredrik
I have done some progress. I found three mistakes that I did.
1) I had dependencies that might have been in conflict with my target environment. Compare image below with previous one.
2) I used mappedName but I never got that to work, see image below what I did instead, for loacl I just needed @EJB.
3) I marked my ejb-member/ejb-field as static, I can not explain why but that just did just not work.
Hope this help some one.
Best regards Fredrik