Hello,
I used this archetype to setup my seam project. For some reason, @In(create=true) doesn't seem to work in the resulting generated code. For example, say I have the following entity:
@Entity
@Name("account")
@Table(name = "account")
public class Account extends AbstractEntity {
// .... etc...
}
When I try to inject an instance of the above entity to:
@Stateful
@Scope(CONVERSATION)
@Name(AccountServiceLocal.NAME)
public class AccountServiceBean extends AbstractEntityServiceBean<Account> implements AccountServiceLocal {
@Logger
Log log;
@In(create = true)
@Out(required = true)
private Account account;
// .....
}
the @In(create=true) annotation is supposed to create a new instance of account if one does not already exist, but all I get is the following exception:
2010-07-09 01:13:05,983 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http-127.0.0.1-8080-1) javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: accountService.account
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)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
...
I've already tried adding @AutoCreate to the entity, but same result. Just curious if you've encountered this issue..
thanks much
FYI, I used seam-gen to create a new project, copied the java code and xhtml files from the project generated from seam/maven archetype into the seam-gen project and tested. The seam-gen project works just fine. @In(create=true) works correctly under the seam-gen project.
I'm going over the config files from both projects and making some comparisons. Your advice would be much appreciated as well...
thanks