6 Replies Latest reply on Feb 15, 2007 6:37 PM by demir ozcelik

    TransientObjectException blues

    demir ozcelik Newbie

      Hi - I am getting an interesting TransientObjectException for the following condition..

      I create a User object in the authenticator and User has a 1-1 relation with a Person object. user instance is outjected as follows..

      @Out(required=false, scope=ScopeType.SESSION)
      private User authenticatedUser;

      My aim is to persist an object with a property of type "User".

      If I use the user object I get from db, create a new X object, set its user property in the same authentication method, it persists x fine.

      However, if I use an "injected" (as follows) authenticatedUser, I get TransientObjectException.

      @In(required=false)
      private User authenticatedUser;

      The interesting part is that, I have a Y object that has a property of type Person. If I create a new Y object and set its person property to injected authenticatedUser.getPerson(), it persists fine.

      So if I assign the injected entity's object property it works, but if I assign the injected entity itself I get the error.

      Any idea is appreciated. Thanks.

        • 1. Re: TransientObjectException blues
          Gavin King Master

          (1) Does User have a natural key or a surrogate key?
          (2) What is the stack trace?

          • 2. Re: TransientObjectException blues
            demir ozcelik Newbie

            Gavin Hi - Thanks for the help offer .. I am pretty darn sure I missed as minute as a semi column somewhere.. hopefully.. I wrote my comments in uppercase to separate them from code.. I am using mysql generated keys.. The problem is summarized in these two lines..

            getInstance().setParty(authenticatedUser.getPerson()); //WORKS
            getInstance().setUser(authenticatedUser); //SAVES PHONE EXCEPT USER FIELD


            I LOG INTO SYSTEM USING THE CODE COPIED FROM SEAMSPACE EXAMPLE..

            ------------------------------- Authenticator.java ----------------------------------------
            package info.veribank.action;

            import ..[clipped]

            @Name("authenticator")
            public class Authenticator
            {
            @In Identity identity;

            @In(create=true)
            private EntityManager entityManager;

            @Out(required=false, scope=ScopeType.SESSION)
            private User authenticatedUser;

            public boolean authenticate()
            {
            try
            {
            User user = (User) entityManager.createQuery(
            "from User where username = :username")
            .setParameter("username", identity.getUsername())
            .getSingleResult();

            authenticatedUser = user;

            return true;
            }
            catch (NoResultException ex)
            {
            return false;
            }
            }
            }

            ------------------------------- End of Authenticator.java ----------------------------------------

            I HAVE A PHONE LIST AND EDIT SCREENS, PHONE AND PHONEHOME GENERATED BY SEAM-GEN

            ------------------------------- User.java ----------------------------------------

            @Entity
            public class User implements Serializable {

            private Long id;
            private Integer version;

            private String username;
            private String password;
            private String hashedPassword;
            private String email;

            private Date createdOn;
            private Person person;

            @OneToOne(fetch = FetchType.LAZY)
            @JoinColumn(name = "PERSON_ID")
            public Person getPerson() {
            return person;
            }

            @Id @GeneratedValue
            public Long getId() {
            return id;
            }
            [clipped]

            ------------------------------- End of User.java ----------------------------------------

            ------------------------------- Person.java ----------------------------------------
            @Entity
            public class Person extends Party { //PARTY IS JUST THERE IN ORDER TO USE ORGANIZATION AND PERSON INTERCHANGEABLY

            //seam-gen attributes (you should probably edit these)

            //add additional entity attributes

            private String firstName;
            private String lastName;

            private User user;

            //seam-gen attribute getters/setters with annotations (you probably should edit)

            public String getFirstName() {
            return firstName;
            }

            public void setFirstName(String firstName) {
            this.firstName = firstName;
            }

            public String getLastName() {
            return lastName;
            }

            public void setLastName(String lastName) {
            this.lastName = lastName;
            }

            @OneToOne(fetch = FetchType.LAZY)
            @JoinColumn(name = "USER_ID")
            public User getUser() {
            return user;
            }

            public void setUser(User user) {
            this.user = user;
            }
            }
            ------------------------------- End of Person.java ----------------------------------------

            ------------------------------- Phone.java ----------------------------------------

            @Entity
            public class Phone implements Serializable {

            private Long id;
            private Integer version;
            private String name;

            Party party;
            String countryCode;
            String areaCode;
            String phoneNo;

            User user;

            @ManyToOne
            public User getUser() {
            return user;
            }

            @Id @GeneratedValue
            public Long getId() {
            return id;
            }

            ------------------------------- End of Phone.java ----------------------------------------

            ------------------------------- PhoneHome.java ----------------------------------------

            @Name("phoneHome")
            public class PhoneHome extends EntityHome
            {
            @RequestParameter
            Long phoneId;

            @In(required=false)
            private User authenticatedUser;

            @Logger
            Log log;

            @Override
            public Object getId()
            {
            if (phoneId==null)
            {
            return super.getId();
            }
            else
            {
            return phoneId;
            }
            }

            @Override @Begin
            public void create() {
            super.create();
            }

            @Override
            public String persist() {
            getInstance().setParty(authenticatedUser.getPerson()); //WORKS
            // getInstance().setUser(authenticatedUser); //SAVES PHONE EXCEPT USER FIELD
            return super.persist();
            }
            }

            ------------------------------- End of PhoneHome.java ----------------------------------------



            This is the error stack ..


            16:57:50,335 INFO [STDOUT] Hibernate: insert into Phone (user_id, party_id, areaCode, countryCode, phoneNo, name, version) values (?, ?, ?, ?, ?, ?, ?)
            16:57:50,443 ERROR [SeamExceptionFilter] uncaught exception
            javax.servlet.ServletException: Error calling action method of component with id phone:save
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:613)
            16:57:50,600 ERROR [SeamExceptionFilter] exception root cause
            javax.faces.FacesException: Error calling action method of component with id phone:save
            at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
            at javax.faces.component.UICommand.broadcast(UICommand.java:106)
            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
            at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
            at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:613)
            Caused by: javax.faces.el.EvaluationException: /phone.xhtml @61,51 action="#{phoneHome.persist}": java.lang.IllegalStateException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: info.veribank.entity.Phone.user -> info.veribank.entity.User
            at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
            at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
            ... 32 more
            Caused by: java.lang.IllegalStateException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: info.veribank.entity.Phone.user -> info.veribank.entity.User
            at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:644)
            at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:299)
            at org.jboss.seam.framework.EntityHome.persist(EntityHome.java:49)
            at info.veribank.action.PhoneHome.persist(PhoneHome.java:52)
            at info.veribank.action.PhoneHome$$FastClassByCGLIB$$2cfa6061.invoke()
            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.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
            at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:79)
            at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
            at sun.reflect.GeneratedMethodAccessor509.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:36)
            at sun.reflect.GeneratedMethodAccessor512.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
            at sun.reflect.GeneratedMethodAccessor474.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
            at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
            at sun.reflect.GeneratedMethodAccessor472.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
            at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
            at sun.reflect.GeneratedMethodAccessor475.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
            at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
            at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
            at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
            at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
            at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
            at info.veribank.action.PhoneHome$$EnhancerByCGLIB$$b7382019.persist()
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
            at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
            ... 33 more
            Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: info.veribank.entity.Phone.user -> info.veribank.entity.User
            at org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:353)
            at org.hibernate.engine.Cascade.cascade(Cascade.java:139)
            at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
            at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
            at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
            at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
            ... 105 more
            16:57:50,796 ERROR [DebugPageHandler] redirecting to debug page
            org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: info.veribank.entity.Phone.user -> info.veribank.entity.User
            at org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:353)
            at org.hibernate.engine.Cascade.cascade(Cascade.java:139)
            at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
            at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
            at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
            at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
            at org.jboss.seam.framework.EntityHome.persist(EntityHome.java:49)
            at info.veribank.action.PhoneHome.persist(PhoneHome.java:52)
            at info.veribank.action.PhoneHome$$FastClassByCGLIB$$2cfa6061.invoke()
            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.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
            at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:79)
            at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
            at sun.reflect.GeneratedMethodAccessor509.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:36)
            at sun.reflect.GeneratedMethodAccessor512.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
            at sun.reflect.GeneratedMethodAccessor474.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
            at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
            at sun.reflect.GeneratedMethodAccessor472.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
            at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
            at sun.reflect.GeneratedMethodAccessor475.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
            at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
            at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
            at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
            at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
            at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
            at info.veribank.action.PhoneHome$$EnhancerByCGLIB$$b7382019.persist()
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
            at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
            at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
            at javax.faces.component.UICommand.broadcast(UICommand.java:106)
            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
            at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
            at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:613)
            16:57:50,946 ERROR [SeamExceptionFilter] could not destroy contexts
            javax.servlet.ServletException: Error calling action method of component with id phone:save
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:613)
            16:57:51,050 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
            java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)
            at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:153)
            at org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:165)
            at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:76)
            at org.jboss.seam.contexts.PageContext.get(PageContext.java:66)
            at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:160)
            at org.jboss.seam.Component.getInstance(Component.java:1635)
            at org.jboss.seam.Component.getInstance(Component.java:1615)
            at org.jboss.seam.Component.getInstance(Component.java:1610)
            at org.jboss.seam.core.PersistenceContexts.instance(PersistenceContexts.java:45)
            at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.entityRefsToIds(ManagedEntityIdentityInterceptor.java:49)
            at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:42)
            at sun.reflect.GeneratedMethodAccessor512.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
            at sun.reflect.GeneratedMethodAccessor474.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
            at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
            at sun.reflect.GeneratedMethodAccessor472.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
            at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
            at sun.reflect.GeneratedMethodAccessor475.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
            at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
            at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
            at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
            at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
            at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
            at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
            at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
            at info.veribank.action.PhoneHome$$EnhancerByCGLIB$$b7382019.clearDirty()
            at org.jboss.seam.contexts.Lifecycle.isAttributeDirty(Lifecycle.java:506)
            at org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:217)
            at org.jboss.seam.exceptions.DebugPageHandler.handle(DebugPageHandler.java:38)
            at org.jboss.seam.core.Exceptions.handle(Exceptions.java:67)
            at org.jboss.seam.servlet.SeamExceptionFilter.endWebRequestAfterException(SeamExceptionFilter.java:77)
            at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:59)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:613)

            • 3. Re: TransientObjectException blues
              Gavin King Master

              Something must be causing the @Id property of the User to get set to null before the new object is flushed to the database. Use your debugger to verify that I am correct about this, and to find out why.

              • 4. Re: TransientObjectException blues
                demir ozcelik Newbie

                Gavin - I verified the value by adding a log..

                @Override
                public String persist() {
                log.info("-->authenticatedUser id = " + authenticatedUser.getId());
                getInstance().setUser(authenticatedUser);
                return super.persist();
                }

                and I got ..

                00:53:28,995 INFO [PhoneHome] -->authenticatedUser id = 1

                So the user and its id is really there.

                The interesting (to me) part is that assigning authenticatedUser does not work but assigning authenticatedUser.getPerson() does as in follows..

                getInstance().setParty(authenticatedUser.getPerson());

                Thanks.

                • 5. Re: TransientObjectException blues
                  Gavin King Master

                  I dunno, you must be doing something weird.

                  If you like, create a very simple, runnable EAR or TestNG test case that reproduces this problem and email it to gavin@hibernate.org. But make sure I don't need to do *anything* in order to make it run - ie. I don't expect to have to futz with creating tables in MySQL, or figuring out how to build the EAR, or trying to futz with missing jars. Deal?

                  • 6. Re: TransientObjectException blues
                    demir ozcelik Newbie

                    I sent out the email today with my real name. Thanks.