Archive
Archive for November 22, 2009
@In attribute requires non-null value: sampleAction.sample
November 22, 2009
5 comments
Hi
If you are new to Seam framework and you get this stupid exception,You should read Seam annotation reference as well. OK this is my code :
[Sample class] …
…
@Name(“sample”)
public Class Sample ..
..
..
and next class is :
@Name(“sampleAction”)
public Class SampleAction …
….
..
@In
private Sample samplepublic void someMethod(){
System.out.println(“I love Seam ….”);
}…
….
And probably you get this exception :
javax.faces.FacesException: #{sampleAction.sample}: org.jboss.seam.
RequiredException: @In attribute requires non-null value: sampleAction.sample
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
javax.faces.component.UICommand.broadcast(UICommand.java:387)
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
OK, You should modify @In annotation :
@In(create=true)
enjoy it …
bye