[jboss-user] [JBoss Seam] - hidden exception issue?
gsegura
do-not-reply at jboss.com
Wed Feb 14 13:14:12 EST 2007
Hello, I'm having this problem with a scenario similar to seamspace registration. This exception is happening:
java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true)
it throws every time I request register.xhtml, it doesn't render since the first request to the page.
It happens even if I just request that page directly from a fresh browser (I mean, no previous navegation in the application was performed)
The problem disappears if I delete any reference to newMember object. To make it less confusing here is the actual code:
The SFSB:
@Stateful
| @Name("register")
| public class RegistroAction implements Register {
|
| @Logger Log log ;
|
| @In EntityManager entityManager ;
|
| @In(required = false)
| private User newUser ;
|
| @In
| private Identity identity;
|
| @Factory("newUser") @Begin
| public void start() {
| newUser = new User();
| }
|
| private String repassword;
|
| public String getRepassword() {
| return this.repassword;
| }
|
| public void setRepassword(String repassword) {
| this.repassword = repassword;
| }
| ...
|
The page:
<ui:define name="body">
| <h:messages globalOnly="true" styleClass="message" />
| <h:form>
| <s:validateAll>
| <div>Nombre: <h:inputText value="#{newUser.name}" required="true" /> </div>
| </s:validateAll>
| <div class="actionButtons">
| <h:commandButton value="Next" action="#{register.next}" />
| </div>
| </h:form>
| </ui:define>
Note that If I just remove #{newUser.name} the page is loaded properly
The entity bean declaration:
@Entity
| @Table(name = "user")
| @NamedQueries( {
| @NamedQuery(name = "User.findById", query = "SELECT p FROM User p WHERE p.id = :id"),
| @NamedQuery(name = "User.findByName", query = "SELECT p FROM User p WHERE p.name = :name"),
| @NamedQuery(name = "User.findByEmail", query = "SELECT p FROM User p WHERE p.email = :email"),
| @NamedQuery(name = "User.findByLoginAndPassword", query = "SELECT p FROM User p WHERE p.login = :login and p.password = :password")
| })
| public class User implements Serializable {
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| @Column(name = "id", nullable = false)
| private Integer id;
|
| @Column(name = "name", nullable = false)
| @NotNull
| @Length(max=150)
| private String name;
|
| @Column(name = "email", nullable = false)
| @NotNull
| @Email
| @Length(max=50)
| private String email;
|
| @Column(name = "login", nullable = false)
| @NotNull
| @Length(max=50)
| private String login;
|
| @Column(name = "password", nullable = false)
| @NotNull
| @Length(min=5,max=50)
| private String password;
|
| @OneToOne(cascade = CascadeType.ALL, mappedBy = "contact")
| private Club club ;
|
| @JoinColumn(name = "clientId", referencedColumnName = "id")
| @ManyToOne
| private Client client;
|
| @Version public int version ;
|
| public User() {
| }
|
| public User(Integer id) { this.id = id; }
|
| /** id */
| public Integer getId() { return this.id; }
|
| public void setId(Integer id) { this.id = id; }
|
| /** nombre */
| public String getNombre() { return this.name; }
|
| public void setNombre(String name) { this.name = name; }
|
| /** email */
| public String getEmail() { return this.email; }
|
| public void setEmail(String email) { this.email = email; }
|
| /** login */
| public String getLogin() { return this.login; }
|
| public void setLogin(String login) { this.login = login; }
|
| /** password */
| public String getPassword() { return this.password; }
|
| public void setPassword(String password) { this.password = password; }
|
| /** client */
| public Client getClient() { return this.client; }
|
| public void setClient(Client client) { this.client = client; }
|
| /** club */
| public Club getClub() { return club ; }
|
| public void setClub(Club club) { this.club = club ; }
|
| @Override
| public int hashCode() {
| int hash = 0;
| hash += (this.id != null ? this.id.hashCode() : 0);
| return hash;
| }
|
| @Override
| public boolean equals(Object object) {
| // TODO: Warning - this method won't work in the case the id fields are not set
| if (!(object instanceof User)) {
| return false;
| }
| User other = (User)object;
| if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
| return true;
| }
|
| @Override
| public String toString() {
| return getId() + ":" + getNombre() ;
| }
|
| }
finally an excerpt of stack trace:
GRAVE: Error Rendering View[/register.xhtml]
| javax.ejb.EJBException: java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true)
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy109.start(Unknown Source)
| at mx.test2.seam.Register$$FastClassByCGLIB$$4f33a91c.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:74)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
I can't see why the reference to #{newUser.name} is throwing this kind of exception.
I found this post
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=87167 that seems similar but my EL expression is very simple.
If I assign values to the newUser properties in the start method (annotated @Factory) nothing changes so makes me think is the EL expression, but again, how so?
I deeply appreciate any help to trace where my error is.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016508#4016508
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016508
More information about the jboss-user
mailing list