com.efl.mobility.puma.business.exceptions.PumaBusinessGeneralException: [com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl and country: null

Hibernate JIRA | Domingo Delgado Guillén | 10 months ago
  1. 0

    I am getting an exception: "Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session: [com.efl.mobility.puma.dao.model.content.ProductDL#ukdipabk]" when I get (find method) an entity by its compound key. This exception only be thrown when one entity, at least, of compound key is previously loaded in session. Simple Entity 1: {code:title=CustomerDL.java|borderStyle=solid} @Entity(name="Customer") public class CustomerDL implements Serializable { private long customerId; ... } {code} Simple entity 2: {code:title=ProductDL.java|borderStyle=solid} @Entity @Table(name="CNT_PRODUCT") public class ProductDL extends Auditory implements Serializable { private String productCod; ... } {code} Entity with compound key: {code:title=SubscriptionDL.java|borderStyle=solid} public class SubscriptionDL implements Serializable { private SubscriptionIdDL subscriptionId; @EmbeddedId public SubscriptionIdDL getSubscriptionId() { return subscriptionId; } public void setSubscriptionId(SubscriptionIdDL subscriptionId) { this.subscriptionId = subscriptionId; } } {code} Embedded id: {code:title=SubscriptionIdDL.java|borderStyle=solid} public class SubscriptionIdDL implements Serializable { private CustomerDL customer; private ProductDL product; @OneToOne @JoinColumn(name="CUS_ID", referencedColumnName="CUS_ID", nullable=false) public CustomerDL getCustomer() { return customer; } public void setCustomer(CustomerDL customer) { this.customer = customer; } @ManyToOne @JoinColumn(name="CNT_PRODUCT_COD", referencedColumnName="CNT_PRODUCT_COD", nullable=false) public ProductDL getProduct() { return product; } public void setProduct(ProductDL product) { this.product = product; } } {code} Steps to reproduce the exception: 1) Load with session find (by id) method an entity of type CustomerDL. 2) Create an entity (also fails if this entity is loaded from session) of type ProductDL and fill its id. 3) Create compound key (SubscriptionIdDL) with (1) and (2) entities. 4) Load with session find (by id) method an entity of type SubscriptionDL using (3) generated Key. Example (using a service layer): {code:title=test.java|borderStyle=solid} ProductSL productSL=productService.get("ukdipabk"); CustomerSL customerSL2=new CustomerSL(); customerSL2.setCustomerId(2L); subscriptionIdSL=new SubscriptionIdSL(); subscriptionIdSL.setProduct(productSL); subscriptionIdSL.setCustomer(customerSL2); subscriptionService.get(subscriptionIdSL); //launch "already associated exception" {code} _emphasis_ NOTE: all code executed in one transaction so one hibernate session. In Hibernate 4 version using exactly same code this work fine. Stacktrace: {panel} 25 ene 2016 17:02:55,316 ERROR [http-nio-8080-exec-2] TransactionInterceptor.completeTransactionAfterThrowing(526) | Application exception overridden by commit exception com.efl.mobility.puma.business.exceptions.PumaBusinessGeneralException: [com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl and country: null at com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer(ContentPumaTADBusinessImpl.java:175) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy50.getAllProductsSubscribedByCustomer(Unknown Source) at com.efl.mobility.puma.ws.impl.BasePumaContentWebService.getProducts(BasePumaContentWebService.java:315) at com.efl.mobility.puma.ws.impl.PumaContentWebServiceImpl.ping(PumaContentWebServiceImpl.java:1367) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.efl.mobility.puma.service.exception.PumaServiceException: Error getting object with id SubscriptionIdSL [customer=CustomerSL [customerId=2, email=null, customerExternalCode=null, application=null, username=null], product=ProductSL [productCod=ukdipabk, productName=The Complete Dismissal Procedures]] from class com.efl.mobility.puma.services.domain.customer.SubscriptionSL at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:73) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:48) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:18) at com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer(ContentPumaTADBusinessImpl.java:172) ... 63 more Caused by: com.efl.mobility.puma.dao.exception.PumaDaoException: Error getting entity of class class com.efl.mobility.puma.dao.model.customer.SubscriptionDL for id SubscriptionIdDL [customer=CustomerDL [customerId=2, username=null], product=ProductDL [productCod=ukdipabk, productName=The Complete Dismissal Procedures]] at com.efl.mobility.puma.dao.jpa.GenericPumaJpaDao.get(GenericPumaJpaDao.java:73) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:61) ... 66 more Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.efl.mobility.puma.dao.model.content.ProductDL#ukdipabk] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1664) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1619) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1106) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1033) at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:293) at com.sun.proxy.$Proxy42.find(Unknown Source) at com.efl.mobility.puma.dao.jpa.GenericPumaJpaDao.get(GenericPumaJpaDao.java:52) ... 67 more {panel}

    Hibernate JIRA | 10 months ago | Domingo Delgado Guillén
    com.efl.mobility.puma.business.exceptions.PumaBusinessGeneralException: [com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl and country: null
  2. 0

    I am getting an exception: "Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session: [com.efl.mobility.puma.dao.model.content.ProductDL#ukdipabk]" when I get (find method) an entity by its compound key. This exception only be thrown when one entity, at least, of compound key is previously loaded in session. Simple Entity 1: {code:title=CustomerDL.java|borderStyle=solid} @Entity(name="Customer") public class CustomerDL implements Serializable { private long customerId; ... } {code} Simple entity 2: {code:title=ProductDL.java|borderStyle=solid} @Entity @Table(name="CNT_PRODUCT") public class ProductDL extends Auditory implements Serializable { private String productCod; ... } {code} Entity with compound key: {code:title=SubscriptionDL.java|borderStyle=solid} public class SubscriptionDL implements Serializable { private SubscriptionIdDL subscriptionId; @EmbeddedId public SubscriptionIdDL getSubscriptionId() { return subscriptionId; } public void setSubscriptionId(SubscriptionIdDL subscriptionId) { this.subscriptionId = subscriptionId; } } {code} Embedded id: {code:title=SubscriptionIdDL.java|borderStyle=solid} public class SubscriptionIdDL implements Serializable { private CustomerDL customer; private ProductDL product; @OneToOne @JoinColumn(name="CUS_ID", referencedColumnName="CUS_ID", nullable=false) public CustomerDL getCustomer() { return customer; } public void setCustomer(CustomerDL customer) { this.customer = customer; } @ManyToOne @JoinColumn(name="CNT_PRODUCT_COD", referencedColumnName="CNT_PRODUCT_COD", nullable=false) public ProductDL getProduct() { return product; } public void setProduct(ProductDL product) { this.product = product; } } {code} Steps to reproduce the exception: 1) Load with session find (by id) method an entity of type CustomerDL. 2) Create an entity (also fails if this entity is loaded from session) of type ProductDL and fill its id. 3) Create compound key (SubscriptionIdDL) with (1) and (2) entities. 4) Load with session find (by id) method an entity of type SubscriptionDL using (3) generated Key. Example (using a service layer): {code:title=test.java|borderStyle=solid} ProductSL productSL=productService.get("ukdipabk"); CustomerSL customerSL2=new CustomerSL(); customerSL2.setCustomerId(2L); subscriptionIdSL=new SubscriptionIdSL(); subscriptionIdSL.setProduct(productSL); subscriptionIdSL.setCustomer(customerSL2); subscriptionService.get(subscriptionIdSL); //launch "already associated exception" {code} _emphasis_ NOTE: all code executed in one transaction so one hibernate session. In Hibernate 4 version using exactly same code this work fine. Stacktrace: {panel} 25 ene 2016 17:02:55,316 ERROR [http-nio-8080-exec-2] TransactionInterceptor.completeTransactionAfterThrowing(526) | Application exception overridden by commit exception com.efl.mobility.puma.business.exceptions.PumaBusinessGeneralException: [com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl and country: null at com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer(ContentPumaTADBusinessImpl.java:175) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy50.getAllProductsSubscribedByCustomer(Unknown Source) at com.efl.mobility.puma.ws.impl.BasePumaContentWebService.getProducts(BasePumaContentWebService.java:315) at com.efl.mobility.puma.ws.impl.PumaContentWebServiceImpl.ping(PumaContentWebServiceImpl.java:1367) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.efl.mobility.puma.service.exception.PumaServiceException: Error getting object with id SubscriptionIdSL [customer=CustomerSL [customerId=2, email=null, customerExternalCode=null, application=null, username=null], product=ProductSL [productCod=ukdipabk, productName=The Complete Dismissal Procedures]] from class com.efl.mobility.puma.services.domain.customer.SubscriptionSL at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:73) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:48) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:18) at com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer(ContentPumaTADBusinessImpl.java:172) ... 63 more Caused by: com.efl.mobility.puma.dao.exception.PumaDaoException: Error getting entity of class class com.efl.mobility.puma.dao.model.customer.SubscriptionDL for id SubscriptionIdDL [customer=CustomerDL [customerId=2, username=null], product=ProductDL [productCod=ukdipabk, productName=The Complete Dismissal Procedures]] at com.efl.mobility.puma.dao.jpa.GenericPumaJpaDao.get(GenericPumaJpaDao.java:73) at com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:61) ... 66 more Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.efl.mobility.puma.dao.model.content.ProductDL#ukdipabk] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1664) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1619) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1106) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1033) at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:293) at com.sun.proxy.$Proxy42.find(Unknown Source) at com.efl.mobility.puma.dao.jpa.GenericPumaJpaDao.get(GenericPumaJpaDao.java:52) ... 67 more {panel}

    Hibernate JIRA | 10 months ago | Domingo Delgado Guillén
    com.efl.mobility.puma.business.exceptions.PumaBusinessGeneralException: [com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl and country: null
  3. 0

    Get javax.persistence.EntityExistsException after update spring libs up to the newest version. (SpringDataRest)

    Stack Overflow | 1 year ago | Andrei
    javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.package.model.B#org.package.model.BPK]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Relation ManyToOne, javax.persistence.EntityExistsException: a different object with the same identifier value was already associated with the session - codeotel.com

    widecodes.com | 1 year ago
    org.springframework.dao.DataIntegrityViolationException: a different object with the same identifier value was already associated with the session: [com.kulig.ap.domain.Location#9]; nested exception is javax.persistence.EntityExistsException: a different object with the same identifier value was already associated with the session: [com.kulig.ap.domain.Location#9]
  6. 0

    a different object with the same identifier value was already associated with the session when trying to persist entity

    dolinked.com | 1 year ago
    javax.persistence.EntityExistsException: a different object with the same identifier value was already associated with the session: [org.black.dmitriy.entity.Schedule#1]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.persistence.EntityExistsException

      A different object with the same identifier value was already associated with the session : [com.efl.mobility.puma.dao.model.content.ProductDL#ukdipabk]

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert()
    2. org.hibernate.jpa
      AbstractEntityManagerImpl.find
      1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1664)
      2. org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1619)
      3. org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1106)
      4. org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1033)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:497)
      3 frames
    4. Spring ORM
      SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke
      1. org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:293)
      1 frame
    5. com.sun.proxy
      $Proxy42.find
      1. com.sun.proxy.$Proxy42.find(Unknown Source)
      1 frame
    6. com.efl.mobility
      ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer
      1. com.efl.mobility.puma.dao.jpa.GenericPumaJpaDao.get(GenericPumaJpaDao.java:52)
      2. com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:61)
      3. com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:48)
      4. com.efl.mobility.puma.service.GenericPumaServiceImpl.get(GenericPumaServiceImpl.java:18)
      5. com.efl.mobility.puma.business.impl.content.ContentPumaTADBusinessImpl.getAllProductsSubscribedByCustomer(ContentPumaTADBusinessImpl.java:172)
      5 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    8. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      3 frames
    9. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      3 frames
    10. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      1 frame
    11. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      3 frames
    12. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      4. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
      4 frames
    13. com.sun.proxy
      $Proxy50.getAllProductsSubscribedByCustomer
      1. com.sun.proxy.$Proxy50.getAllProductsSubscribedByCustomer(Unknown Source)
      1 frame
    14. com.efl.mobility
      PumaContentWebServiceImpl.ping
      1. com.efl.mobility.puma.ws.impl.BasePumaContentWebService.getProducts(BasePumaContentWebService.java:315)
      2. com.efl.mobility.puma.ws.impl.PumaContentWebServiceImpl.ping(PumaContentWebServiceImpl.java:1367)
      2 frames
    15. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    16. Apache CXF Core
      AbstractInvoker.invoke
      1. org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
      2. org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
      2 frames
    17. Apache CXF Runtime JAX-RS Frontend
      JAXRSInvoker.invoke
      1. org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
      2. org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
      2 frames
    18. Apache CXF Core
      ChainInitiationObserver.onMessage
      1. org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
      2. org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
      3. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
      4. org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      4 frames
    19. Apache CXF Runtime HTTP Transport
      AbstractHTTPServlet.doGet
      1. org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
      2. org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
      3. org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
      4. org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
      5. org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
      6. org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
      7. org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217)
      7 frames
    20. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      1 frame
    21. Apache CXF Runtime HTTP Transport
      AbstractHTTPServlet.service
      1. org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
      1 frame
    22. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    23. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      1 frame
    24. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      8. org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
      10 frames
    25. Grizzly HTTP
      NioEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
      3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      4 frames
    26. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2 frames
    27. Tomcat Util
      TaskThread$WrappingRunnable.run
      1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      1 frame
    28. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame