私はWebsphere 8.5.5で動作するようにアプリケーションを調整していますが、私のアプリケーションはEJBを注入しませんが、Jboss 7.1.1の同じアプリケーションは正常に動作することがわかりました。EJB return null Websphere
その後、私はダミーのアプリケーションを作成し、動作しません(2つの整数を追加するだけです)。
誰かが私を助けることができますか?
編集:
package resources;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import co.com.prueba.local.SumadorLocal;
@ManagedBean
@ViewScoped
public class SumadorUI {
private Integer a;
private Integer b;
private Integer c;
@EJB
private SumadorLocal sumadorLocal;
@PostConstruct
private void init(){
System.out.println("Init :"+sumadorLocal);
}
public String sumar(){
c=sumadorLocal.sumador(a, b);
return null;
}
public Integer getA() {
return a;
}
public void setA(Integer a) {
this.a = a;
}
public Integer getB() {
return b;
}
public void setB(Integer b) {
this.b = b;
}
public Integer getC() {
return c;
}
public void setC(Integer c) {
this.c = c;
}
}
更新:問題の注入はManagedBeanまたはすべてのアプリであり、そして唯一の問題はManagedBeanある場合
を私がテストに新しいEJBを追加します。
コードや具体的な観察を掲載する必要があります。 – covener
あなたのタグだけに基づいて、JSFを使用していると仮定します。提供されたJSF実装のみが[CDIと統合されています](http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/cweb_cdi_integration.html?lang=ja)理由があるかもしれないカスタムJSFライブラリーを使用するならば。コードの断片と詳細な説明を提供する'@Inject'を使用している場合は' @ EJB'を試してください – Gas
どのようにしてSumadorUIのインスタンスを作成していますか? –