I'm currently experimenting a little with Apache MyFaces CODI. I managed to create a simple working Typesafe-Navigation using @Page and an action Method which returns a Class.
However, when I'm adding an @PageBean-Annotation with e.g. MyPageBean.class, the following exception is thrown when I try to navigate to the page:
exception
javax.servlet.ServletException: WELD-001324 Argument bean must not be null
root cause
org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null
The code of my page is:
@Page
@PageBean(MyPageBean.class)
public final class MyPage implements ViewConfig, Serializable {
}
and my Page-Bean:
public class MyPageBean implements Serializable {
@InitView
protected void initView() { }
@PrePageAction
protected void prePageAction() { }
@PreRenderView
protected void preRenderView() { }
}
And the Action-Method called by the Facelets Page:
public Class<? extends ViewConfig> nextPage() {
return MyPage.class;
}
Does the pageBean-Class (MyPageBean) need to have a specific annotation or interface? I already tried using @Model but this didn't change anything.
My Configuration:
- Jave EE6 with Weld (created using the weld-archetype)
- Glassfish 3.1 Community Edition (The one shipped with Netbeans 7)
- JSF2.0 (Mojarra 2.1)
- EJB 3.1
- MyFaces CODI 0.9.4
- RichFaces 4.0.0.Final
Thanks for any advices!
Best regards, Robert