Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-b6, 2.0
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-11907Copy Permission throws org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException
      KULRICE-8673Copy Permission not validating New Copy for duplicate Permission Name
      KULRICE-7881Copying/Creating a permission is not populating permission identifier even when the document is routed.
      KULRICE-8854Permission doc creating a duplicate permission can be submitted but routes to exception
      KULRICE-10773Add permission check the Transactional Document copy method
      KULRICE-8644When trying to copy certain permissions, doc gets stuck 'Enroute'
      KULRICE-7536getPermissionTypeServicesByTemplateId can fetch permission type more than once
      KULRICE-7832Role 54 user can edit person, group, role, parameter documents
      KULRICE-6999When creating, copying, or editing a permission the "Permission ID" shows up as a blank value
      KULRICE-10417Inquiry Permission Gap Analysis: checks for if a hidden field can be displayed
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      Copying a permission doesn't work because the OBJ_ID gets copied, and isn't reset before attempting persistence. I suspect this will be a problem for other maint docs too.

        Issue Links

          Activity

          Hide
          Eric Westfall added a comment -

          This seems like a critical bug, escalating the priority.

          Show
          Eric Westfall added a comment - This seems like a critical bug, escalating the priority.
          Eric Westfall made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Critical [ 2 ]
          Hide
          Peter Giles (Inactive) added a comment -

          Some additional info here. The following snippet from the table creation sql for krim_perm_t shows that the constraint being violated is a unique constraint on obj_id:

          CREATE TABLE `krim_perm_t` (
            `PERM_ID` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '',
            `OBJ_ID` varchar(36) COLLATE utf8_bin NOT NULL,
            `VER_NBR` decimal(8,0) NOT NULL DEFAULT '1',
            `PERM_TMPL_ID` varchar(40) COLLATE utf8_bin DEFAULT NULL,
            `NMSPC_CD` varchar(40) COLLATE utf8_bin NOT NULL,
            `NM` varchar(100) COLLATE utf8_bin NOT NULL,
            `DESC_TXT` varchar(400) COLLATE utf8_bin DEFAULT NULL,
            `ACTV_IND` varchar(1) COLLATE utf8_bin DEFAULT 'Y',
            PRIMARY KEY (`PERM_ID`),
            UNIQUE KEY `KRIM_PERM_TC0` (`OBJ_ID`),
            UNIQUE KEY `KRIM_PERM_T_TC1` (`NM`,`NMSPC_CD`),
            KEY `KRIM_PERM_TR1` (`PERM_TMPL_ID`),
            CONSTRAINT `KRIM_PERM_TR1` FOREIGN KEY (`PERM_TMPL_ID`) REFERENCES `krim_perm_tmpl_t` (`PERM_TMPL_ID`)
          )
          

          Here's the stack trace:

          2011-11-28 15:12:46,926 [TRAVEL/KSB-pool-1-thread-3] u:admin/d:3040 ERROR org.apache.ojb.broker.accesslayer.JdbcAccessImpl - 
          * SQLException during execution of sql-statement:
          * sql statement was 'INSERT INTO KRIM_PERM_T (PERM_ID,NMSPC_CD,NM,DESC_TXT,PERM_TMPL_ID,ACTV_IND,VER_NBR,OBJ_ID) VALUES (?,?,?,?,?,?,?,?) '
          * Exception message is [Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0']
          * Vendor error code [1062]
          * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION]
          * Target class is 'org.kuali.rice.kim.impl.permission.PermissionBo'
          * PK of the target object is [id=10003]
          * Source object: org.kuali.rice.kim.impl.permission.PermissionBo@1c80b08[id=10003,namespaceCode=KR-SAP,name=Maintain KRMS Agenda,description=Allows creation and modification of agendas via the agenda editor,templateId=10001,active=true,template=org.kuali.rice.kim.impl.permission.PermissionTemplateBo@159972c[id=10001,namespaceCode=KR-RULE,name=KRMS Agenda Permission,description=View/Maintain Agenda,kimTypeId=67,active=true,versionNumber=1,objectId=AE3195EDFF2400E2E0404F8189D822AE,newCollectionRecord=false,extension=<null>],attributeDetails=[],attributes={},rolePermissions=org.springframework.util.AutoPopulatingList@1,dataDictionaryService=<null>,kimTypeInfoService=<null>,versionNumber=2,objectId=AE3195EDFF2500E2E0404F8189D822AE,newCollectionRecord=false,extension=<null>]
          * The root stack trace is --> 
          * com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0'
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          	at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
          	at com.mysql.jdbc.Util.getInstance(Util.java:382)
          	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
          	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603)
          	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535)
          	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989)
          	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150)
          	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
          	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
          	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
          	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333)
          	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318)
          	at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102)
          	at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source)
          	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
          	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
          	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
          	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
          	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
          	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
          	at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246)
          	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141)
          	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244)
          	at org.kuali.rice.krad.dao.impl.BusinessObjectDaoOjb.save(BusinessObjectDaoOjb.java:238)
          	at org.kuali.rice.krad.dao.proxy.BusinessObjectDaoProxy.save(BusinessObjectDaoProxy.java:245)
          	at sun.reflect.GeneratedMethodAccessor951.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:597)
          	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
          	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
          	at $Proxy54.save(Unknown Source)
          	at org.kuali.rice.krad.service.impl.BusinessObjectServiceImpl.save(BusinessObjectServiceImpl.java:70)
          	at sun.reflect.GeneratedMethodAccessor950.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:597)
          	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
          	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
          	at $Proxy55.save(Unknown Source)
          	at org.kuali.rice.kim.impl.permission.PermissionServiceImpl.createPermission(PermissionServiceImpl.java:496)
          	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:597)
          ...
          
          Show
          Peter Giles (Inactive) added a comment - Some additional info here. The following snippet from the table creation sql for krim_perm_t shows that the constraint being violated is a unique constraint on obj_id: CREATE TABLE `krim_perm_t` ( `PERM_ID` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '', `OBJ_ID` varchar(36) COLLATE utf8_bin NOT NULL, `VER_NBR` decimal(8,0) NOT NULL DEFAULT '1', `PERM_TMPL_ID` varchar(40) COLLATE utf8_bin DEFAULT NULL, `NMSPC_CD` varchar(40) COLLATE utf8_bin NOT NULL, `NM` varchar(100) COLLATE utf8_bin NOT NULL, `DESC_TXT` varchar(400) COLLATE utf8_bin DEFAULT NULL, `ACTV_IND` varchar(1) COLLATE utf8_bin DEFAULT 'Y', PRIMARY KEY (`PERM_ID`), UNIQUE KEY `KRIM_PERM_TC0` (`OBJ_ID`), UNIQUE KEY `KRIM_PERM_T_TC1` (`NM`,`NMSPC_CD`), KEY `KRIM_PERM_TR1` (`PERM_TMPL_ID`), CONSTRAINT `KRIM_PERM_TR1` FOREIGN KEY (`PERM_TMPL_ID`) REFERENCES `krim_perm_tmpl_t` (`PERM_TMPL_ID`) ) Here's the stack trace: 2011-11-28 15:12:46,926 [TRAVEL/KSB-pool-1-thread-3] u:admin/d:3040 ERROR org.apache.ojb.broker.accesslayer.JdbcAccessImpl - * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO KRIM_PERM_T (PERM_ID,NMSPC_CD,NM,DESC_TXT,PERM_TMPL_ID,ACTV_IND,VER_NBR,OBJ_ID) VALUES (?,?,?,?,?,?,?,?) ' * Exception message is [Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0'] * Vendor error code [1062] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'org.kuali.rice.kim.impl.permission.PermissionBo' * PK of the target object is [id=10003] * Source object: org.kuali.rice.kim.impl.permission.PermissionBo@1c80b08[id=10003,namespaceCode=KR-SAP,name=Maintain KRMS Agenda,description=Allows creation and modification of agendas via the agenda editor,templateId=10001,active= true ,template=org.kuali.rice.kim.impl.permission.PermissionTemplateBo@159972c[id=10001,namespaceCode=KR-RULE,name=KRMS Agenda Permission,description=View/Maintain Agenda,kimTypeId=67,active= true ,versionNumber=1,objectId=AE3195EDFF2400E2E0404F8189D822AE,newCollectionRecord= false ,extension=< null >],attributeDetails=[],attributes={},rolePermissions=org.springframework.util.AutoPopulatingList@1,dataDictionaryService=< null >,kimTypeInfoService=< null >,versionNumber=2,objectId=AE3195EDFF2500E2E0404F8189D822AE,newCollectionRecord= false ,extension=< null >] * The root stack trace is --> * com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.Util.getInstance(Util.java:382) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318) at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244) at org.kuali.rice.krad.dao.impl.BusinessObjectDaoOjb.save(BusinessObjectDaoOjb.java:238) at org.kuali.rice.krad.dao.proxy.BusinessObjectDaoProxy.save(BusinessObjectDaoProxy.java:245) at sun.reflect.GeneratedMethodAccessor951.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy54.save(Unknown Source) at org.kuali.rice.krad.service.impl.BusinessObjectServiceImpl.save(BusinessObjectServiceImpl.java:70) at sun.reflect.GeneratedMethodAccessor950.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy55.save(Unknown Source) at org.kuali.rice.kim.impl.permission.PermissionServiceImpl.createPermission(PermissionServiceImpl.java:496) 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:597) ...
          Jessica Coltrin (Inactive) made changes -
          Fix Version/s 2.0.0-b5 [ 16377 ]
          Jessica Coltrin (Inactive) made changes -
          Start Date
          Fix Date 2012-01-09 [ set to sprint end date ]
          Peter Giles (Inactive) made changes -
          Rice Lead sgibson jjhanso
          Jeremy Hanson made changes -
          Assignee sona sona [ sonam ]
          Sona Sona (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Sona Sona (Inactive) added a comment -

          When you do a copy the objectId already has a value which does not get reset and there is unique constraint on that column. This seems to be the problem with a lot of other maintainable documents also.
          Responsibility
          Namespace
          Component
          Campus
          Country
          PostalCode
          State
          Campus Type

          Show
          Sona Sona (Inactive) added a comment - When you do a copy the objectId already has a value which does not get reset and there is unique constraint on that column. This seems to be the problem with a lot of other maintainable documents also. Responsibility Namespace Component Campus Country PostalCode State Campus Type
          Hide
          Sona Sona (Inactive) added a comment - - edited

          I committed a fix for the other maintainable documents except responsibility. The template info and the edit/copy actions disappear when you do an edit/copy for Responsibility. Cannot test Permissions since the Edit/Copy actions do not show up for Permissions. I have created a separate jira for that.

          Show
          Sona Sona (Inactive) added a comment - - edited I committed a fix for the other maintainable documents except responsibility. The template info and the edit/copy actions disappear when you do an edit/copy for Responsibility. Cannot test Permissions since the Edit/Copy actions do not show up for Permissions. I have created a separate jira for that.
          Sona Sona (Inactive) made changes -
          Link This issue relies on KULRICE-6390 [ KULRICE-6390 ]
          Hide
          Sona Sona (Inactive) added a comment -

          Edit/Copy Responsibility has also been fixed.

          Show
          Sona Sona (Inactive) added a comment - Edit/Copy Responsibility has also been fixed.
          Hide
          Sona Sona (Inactive) added a comment -

          Edit/copy is now working for Permissions.

          Show
          Sona Sona (Inactive) added a comment - Edit/copy is now working for Permissions.
          Sona Sona (Inactive) made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Peter Giles (Inactive) made changes -
          Link This issue cloned to KULRICE-6451 [ KULRICE-6451 ]
          Hide
          Jessica Coltrin (Inactive) added a comment -

          Closing since these items are now in the release notes.

          Show
          Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.
          Jessica Coltrin (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dan Lemus (Inactive) made changes -
          Link This issue relates to KULRICE-6892 [ KULRICE-6892 ]
          Shem Patterson (Inactive) made changes -
          Workflow custom [ 104917 ] Copy of custom for rice [ 213386 ]
          Shem Patterson (Inactive) made changes -
          Workflow Copy of custom for rice [ 213386 ] custom [ 223134 ]
          Shem Patterson (Inactive) made changes -
          Workflow custom [ 223134 ] Rice Workflow [ 232882 ]

            People

            • Assignee:
              Sona Sona (Inactive)
              Reporter:
              Peter Giles (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel