0
我有以下對象結構:EJB Inyection抽象類
public abstract class RGBusinessLogic {
@EJB
protected RGBeanLocal rgb;
public abstract String foo(String x, String y);
public void bar(){
...some code...
rgb.anyFunction(... some params...);
...some code...
foo(someStringX,someStringY);
... some code...
}
public String bazz(){
... some code...
}
}
@Stateless
public class RGEnqueuerResource extends RGBusinessLogic {
@Override
public String foo(String a,String b){
...some code...
wa = rbg.anyOtherFunction(...some params...);
...some code...
}
}
/** that is a Rest Services **/
@Path("somePath")
@RequestScoped
public class RGEnqueuerResourceRest extends RGEnqueuerResource{
@POST
@Path("fooRest")
public String foo(
@FormParam("paramA") String a,
@FormParam("paramB") String b){
return super.foo(x,y);
}
@POST
@Path("bazzRest")
public String bazz(){
return super.bazz();
}
}
主要思路如下設計:我有工廠化上RGBusinessLogic繼承倍數類和其他子類實現的abtract一些代碼碼。
當我得到RGEnqueuerResourceRest.foo
一個POST請求,在我行獲得NullPointerException
wa = rbg.anyOtherFunction(...some params...);
看起來像rgb
EJB沒有被正確注射。我想知道你是否可以找出這裏發生的事情?