com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '16' for key 'PRIMARY' Error Code: 1062 Call: INSERT INTO unit (id, addr_street, addr_building, admin_email, version, addr_postcode, addr_room, addr_city, name, descr, admin_phone, winDomain, dynamicEnabled, authority_id, organization_id, aup_policy_id, alert_policy_id, image_policy_id, monitor_policy_id, audit_event_policy_id, parent_id, access_policy_id, lib_policy_id, web_policy_id, ldap_sync_policy_id, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [16, null, null, , 1, null, null, null, USER GROUP, null, null, null, false, 2, 3, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 5] Query: WriteObjectQuery(UserGroup:16 USER GROUP)

javatalks.ru | 9 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    javatalks.ru / EJB+JPA+AspectJ, MySQLIntegrityConstraintViolationException

    javatalks.ru | 9 months ago
    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '16' for key 'PRIMARY' Error Code: 1062 Call: INSERT INTO unit (id, addr_street, addr_building, admin_email, version, addr_postcode, addr_room, addr_city, name, descr, admin_phone, winDomain, dynamicEnabled, authority_id, organization_id, aup_policy_id, alert_policy_id, image_policy_id, monitor_policy_id, audit_event_policy_id, parent_id, access_policy_id, lib_policy_id, web_policy_id, ldap_sync_policy_id, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [16, null, null, , 1, null, null, null, USER GROUP, null, null, null, false, 2, 3, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 5] Query: WriteObjectQuery(UserGroup:16 USER GROUP)

    Root Cause Analysis

    1. com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException

      Duplicate entry '16' for key 'PRIMARY' Error Code: 1062 Call: INSERT INTO unit (id, addr_street, addr_building, admin_email, version, addr_postcode, addr_room, addr_city, name, descr, admin_phone, winDomain, dynamicEnabled, authority_id, organization_id, aup_policy_id, alert_policy_id, image_policy_id, monitor_policy_id, audit_event_policy_id, parent_id, access_policy_id, lib_policy_id, web_policy_id, ldap_sync_policy_id, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [16, null, null, , 1, null, null, null, USER GROUP, null, null, null, false, 2, 3, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 5] Query: WriteObjectQuery(UserGroup:16 USER GROUP)

      at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException()
    2. OpenEJB :: OSGi :: Core
      BaseEjbProxyHandler.invoke
      1. org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:345)
      2. org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:291)
      2 frames
    3. Unknown
      $Proxy123.isDirectState
      1. $Proxy123.isDirectState(Unknown Source)
      1 frame
    4. org.securus.units
      InheriteUnitValue.onAfter
      1. org.securus.units.InheriteUnitValue.inherite(InheriteUnitValue.java:111)
      2. org.securus.units.InheriteUnitValue.onAfter(InheriteUnitValue.java:77)
      2 frames
    5. org.securus.application
      ChangeValueAspect.afterSetValue
      1. org.securus.application.aspect.ChangeValueAspect$AfterCaller.callListener(ChangeValueAspect.java:75)
      2. org.securus.application.aspect.ChangeValueAspect.callClassListeners(ChangeValueAspect.java:131)
      3. org.securus.application.aspect.ChangeValueAspect.doAction(ChangeValueAspect.java:107)
      4. org.securus.application.aspect.ChangeValueAspect.afterSetValue(ChangeValueAspect.java:87)
      4 frames
    6. org.securus.units
      UserImpl.setParentGroup
      1. org.securus.units.UserImpl.setParentGroup(UserImpl.java:125)
      1 frame
    7. org.securus.application
      LDAPSyncBean.ejbTimeout
      1. org.securus.application.ldap.LDAPSyncBean.syncUser(LDAPSyncBean.java:570)
      2. org.securus.application.ldap.LDAPSyncBean.syncUserGroup(LDAPSyncBean.java:394)
      3. org.securus.application.ldap.LDAPSyncBean.checkSync(LDAPSyncBean.java:134)
      4. org.securus.application.ldap.LDAPSyncBean.ejbTimeout(LDAPSyncBean.java:86)
      4 frames
    8. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    9. OpenEJB :: OSGi :: Core
      EjbTimerServiceImpl$EjbTimeoutTimerTask$1.run
      1. org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
      2. org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
      3. org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
      4. org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:211)
      5. org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
      6. org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:284)
      7. org.apache.openejb.core.timer.EjbTimerServiceImpl.access$100(EjbTimerServiceImpl.java:43)
      8. org.apache.openejb.core.timer.EjbTimerServiceImpl$EjbTimeoutTimerTask$1.run(EjbTimerServiceImpl.java:350)
      8 frames
    10. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      3. java.lang.Thread.run(Thread.java:619)
      3 frames