I am currently using the latest code of DHIS taken from the trunk. I am trying to create new users by replicating an existing user ('Replicate’ available from the context menu of users). However, whenever I assign a username, password and click on “Replicate”, an exception is thrown in the logs and there’s a warning shown on the DHIS header.
Attached are screenshots depicting the issue mentioned.
Here are the logs for the exception thrown:
INFO 2016-03-29 15:50:39,210 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
INFO 2016-03-29 15:50:39,211 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
* ERROR 2016-03-29 15:50:39,219 Exception happened while trying to invoke the request URL:/api/users/o47o9bP7Okh/replica (CrudControllerAdvice.java [qtp598569407-849])
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [uk_efqukogbk7i0poucwoy2qie74]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
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.$Proxy63.addUserCredentials(Unknown Source)
at org.hisp.dhis.webapi.controller.user.UserController.replicateUser(UserController.java:360)
at org.hisp.dhis.webapi.controller.user.UserController$$FastClassBySpringCGLIB$$e199246.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$66052cb1.replicateUser(<generated>)
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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
It is helpful to the developers if you can place your bugs in launchpad, particularly if you can reproduce them. There is often a lot of traffic on this list and it’s easy to lose track of them.
I am currently using the latest code of DHIS taken from the trunk. I am trying to create new users by replicating an existing user ('Replicate’ available from the context menu of users). However, whenever I assign a username, password and click on “Replicate”, an exception is thrown in the logs and there’s a warning shown on the DHIS header.
Attached are screenshots depicting the issue mentioned.
Here are the logs for the exception thrown:
INFO 2016-03-29 15:50:39,210 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
INFO 2016-03-29 15:50:39,211 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
* ERROR 2016-03-29 15:50:39,219 Exception happened while trying to invoke the request URL:/api/users/o47o9bP7Okh/replica (CrudControllerAdvice.java [qtp598569407-849])
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [uk_efqukogbk7i0poucwoy2qie74]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
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.$Proxy63.addUserCredentials(Unknown Source)
at org.hisp.dhis.webapi.controller.user.UserController.replicateUser(UserController.java:360)
at org.hisp.dhis.webapi.controller.user.UserController$$FastClassBySpringCGLIB$$e199246.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$66052cb1.replicateUser()
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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
It is helpful to the developers if you can place your bugs in launchpad, particularly if you can reproduce them. There is often a lot of traffic on this list and it’s easy to lose track of them.
I am currently using the latest code of DHIS taken from the trunk. I am trying to create new users by replicating an existing user ('Replicate’ available from the context menu of users). However, whenever I assign a username, password and click on “Replicate”, an exception is thrown in the logs and there’s a warning shown on the DHIS header.
Attached are screenshots depicting the issue mentioned.
Here are the logs for the exception thrown:
INFO 2016-03-29 15:50:39,210 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
INFO 2016-03-29 15:50:39,211 ‘admin’ create org.hisp.dhis.user.User, name: local admin, uid: cIE6puaCJvv (AuditLogUtil.java [qtp598569407-849])
* ERROR 2016-03-29 15:50:39,219 Exception happened while trying to invoke the request URL:/api/users/o47o9bP7Okh/replica (CrudControllerAdvice.java [qtp598569407-849])
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [uk_efqukogbk7i0poucwoy2qie74]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
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.$Proxy63.addUserCredentials(Unknown Source)
at org.hisp.dhis.webapi.controller.user.UserController.replicateUser(UserController.java:360)
at org.hisp.dhis.webapi.controller.user.UserController$$FastClassBySpringCGLIB$$e199246.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$66052cb1.replicateUser(<generated>)
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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)