This content has been marked as final.
Show 4 replies
-
1. Re: In attribute requires non-null value:
joblini Feb 23, 2009 3:36 AM (in response to oyesiji77)Add @AutoCreate to the component, or use @In with "create=true"
-
2. Re: In attribute requires non-null value:
kragoth Feb 24, 2009 1:56 AM (in response to oyesiji77)Or alternatively add
@Startup to your Storage class. This will instantiate an instance of this component when the session is started.Plenty of ways to do this.
-
3. Re: In attribute requires non-null value:
allllllan Jul 9, 2010 6:50 AM (in response to oyesiji77)@In(create=true) isn't creating an instance of my component for some reason. I have:
@Entity
@Name("account")
public class Account {
......
}
and
@Stateful
@Scope(CONVERSATION)
@Name("accountService")
public class AccountServiceBean implements AccountService {
@Logger
Log log;
@In(create = true) // This isn't creating a new instance if account is null
@Out(required = true)
private Account account;
@Create
public void init() {
// My not-so-ideal workaround...
if (account == null) {
log.info("Account instance was null here! Should NOT have been null!");
account = new Account();
}
}
.......
}
I get the following if I don't use the @Create method above to init the account component:
javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: accountService.account
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
.
.
.
.
I never had this issue in my previous seam project. For some reason, @In(create=true) doesn't seem to work anymore. I've scoured the net looking for anything related to this issue. This post is best I could find. Hoping others in the forum might have seen this issue and offer some advice...
Using seam 2.2.0.GA
thanks -
4. Re: In attribute requires non-null value:
kragoth Jul 11, 2010 7:31 PM (in response to oyesiji77)Try
@In(create=true, required=true) @Out(required=true) private Account account;
I have a funny feeling you need the required=true to make it work the way you want.