Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-839

Don't allow privileges to be deleted if they are in use

    XMLWordPrintable

    Details

      Description

      You are currently allowed to delete a privilege that belongs to a role.

      Then when you try to view the role you get something like this:

      An Internal Error has Occured
      org.hibernate.ObjectNotFoundException

      No row with the given identifier exists: the system

      Consult the help document.
      Contact your friendly neighborhood administrator if it cannot be resolved.

      Hide stack trace
      org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
      org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)
      org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
      org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
      org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
      org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557)
      org.hibernate.type.EntityType.resolve(EntityType.java:379)
      org.hibernate.type.EntityType.nullSafeGet(EntityType.java:204)
      org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:703)
      org.hibernate.collection.PersistentSet.readFrom(PersistentSet.java:318)
      org.hibernate.loader.Loader.readCollectionElement(Loader.java:1008)
      org.hibernate.loader.Loader.readCollectionElements(Loader.java:646)
      org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591)
      org.hibernate.loader.Loader.doQuery(Loader.java:701)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
      org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
      org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
      org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
      org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
      org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
      org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
      org.hibernate.loader.Loader.doList(Loader.java:2220)
      org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      org.hibernate.loader.Loader.list(Loader.java:2099)
      org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
      org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      org.openmrs.api.db.hibernate.HibernateUserDAO.getAllRoles(Unknown Source)
      org.openmrs.api.impl.UserServiceImpl.getAllRoles(Unknown Source)
      org.openmrs.api.impl.UserServiceImpl.getRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy58.getRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.openmrs.aop.LoggingAdvice.invoke(Unknown Source)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy59.getRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy59.getRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
      $Proxy102.getRoles(Unknown Source)
      org.openmrs.web.controller.user.RoleListController.formBackingObject(Unknown Source)
      org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:358)
      org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:338)
      org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:278)
      org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.openmrs.web.OpenmrsFilter.doFilter(Unknown Source)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
      org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
      org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
      org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
      org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      java.lang.Thread.run(Thread.java:619)

      Version: 1.3.0.11 RC1 Build 4494
      Database Version: 1.3.0.11

        Attachments

          Activity

            People

            Assignee:
            bwolfe Ben Wolfe
            Reporter:
            darius Darius Jazayeri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: