2017-08-23 6 views
1

私はTomEEサーバーでJSF 2.3を使用しようとしていましたが、FacesContextオブジェクトで@Inject注釈を使用する際に問題があります。FacesContextをJSF 2.3とTomEEに挿入するには?

私はそれを使用すると、私のTomEEサーバの起動時に、私は次の例外を取得:

SEVERE: CDI Beans module deployment failed 
org.apache.webbeans.exception.WebBeansDeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [javax.faces.context.FacesContext] is not found with the qualifiers 
Qualifiers: [@javax.enterprise.inject.Default()] 

私は何かが足りないのですか?おかげさまで

答えて

0

JSF2.3の機能のいくつかは、使用されているJSFバージョンを設定することによってアクティブにする必要があるようです。

この空のクラスを追加することによって、JSFのバージョンを設定してみてください:

import javax.faces.annotation.FacesConfig; 

/** 
* The presence of the @FacesConfig annotation on a managed bean deployed within an application enables version specific 
* features. In this case, it enables JSF CDI injection and EL resolution using CDI. 
* 
*/ 
@FacesConfig(version = FacesConfig.Version.JSF_2_3) 
public class ConfigurationBean { 
} 

https://github.com/javaee/glassfish/issues/22094

から
関連する問題