0 Replies Latest reply on Feb 25, 2010 6:59 PM by mohamed shaftri

    PersistanceManager confusion

    mohamed shaftri Newbie

      Hello

       

      Iam work on project suing EJB but it give me this

      Error
      prepare:

      compile:

      ejbjar:

      run.client:
           [java] Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.ck.domain.Borrower
           [java]     at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
           [java]     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
           [java]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
           [java]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
           [java]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
           [java]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
           [java]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
           [java] Caused by: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.ck.domain.Borrower
           [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
           [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
           [java]     at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
           [java]     at com.ck.library.BrSlLibrary.createBrrower(BrSlLibrary.java:17)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           [java]     at java.lang.reflect.Method.invoke(Method.java:597)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
           [java]     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
           [java]     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           [java]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
           [java]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
           [java]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
           [java]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
           [java]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
           [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:1634)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:548)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
           [java]     at $Proxy0.createBrrower(Unknown Source)
           [java]     at com.ck.clients.Client.main(Client.java:35)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
           [java]     at $Proxy0.createBrrower(Unknown Source)
           [java]     at com.ck.clients.Client.main(Client.java:35)
           [java] Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: com.ck.domain.Borrower
           [java]     at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
           [java]     at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
           [java]     at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
           [java]     at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
           [java]     at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
           [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
           [java]     at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
           [java]     at com.ck.library.BrSlLibrary.createBrrower(BrSlLibrary.java:17)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           [java]     at java.lang.reflect.Method.invoke(Method.java:597)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
           [java]     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
           [java]     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           [java]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
           [java]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           [java]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
           [java]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
           [java]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
           [java]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
           [java]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
           [java] Java Result: 1

      this is my entityborrower beans