Uploaded image for project: 'Metadata Sharing Module'
  1. Metadata Sharing Module
  2. META-227

Starting in OpenMRS 1.9 you are not allowed to modify ConceptDatatypes, so we need to stop exporting/importing them

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: 1.0.7
    • Fix Version/s: 1.0.8
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      Starting in OpenMRS 1.9 we no longer allow saveConceptDatatype, which leads to this exception when you try to import a MDS package containing one:

      ...
      Caused by: org.openmrs.api.db.DAOException: Error saving org.openmrs.ConceptDatatype_$$_javassist_65 [8d4a4488-c2cc-11de-8d13-0010c6dffd0f]
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:110)
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:33)
      	at org.openmrs.module.metadatasharing.handler.Handler.saveItem(Handler.java:38)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:317)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:312)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:312)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.importItems(ImportPackageTask.java:238)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.execute(ImportPackageTask.java:88)
      	... 46 more
      Caused by: org.openmrs.api.APIException: Cannot save org.openmrs.ConceptDatatype[8d4a4488-c2cc-11de-8d13-0010c6dffd0f]. Failed with the following exception:
      
      java.lang.reflect.InvocationTargetException
      	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)
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.invokeServiceSaveItem(OpenmrsClassScanner.java:254)
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.serviceSaveItem(OpenmrsClassScanner.java:174)
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:107)
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:33)
      	at org.openmrs.module.metadatasharing.handler.Handler.saveItem(Handler.java:38)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:317)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:312)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.saveItem(ImportPackageTask.java:312)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.importItems(ImportPackageTask.java:238)
      	at org.openmrs.module.metadatasharing.task.impl.ImportPackageTask.execute(ImportPackageTask.java:88)
      	at org.openmrs.module.metadatasharing.api.impl.MetadataSharingServiceImpl$1.task(MetadataSharingServiceImpl.java:203)
      	at org.openmrs.module.metadatasharing.api.db.hibernate.CustomSessionFlushTask.executeInManualFlushMode(CustomSessionFlushTask.java:59)
      	at org.openmrs.module.metadatasharing.api.impl.MetadataSharingServiceImpl.executeTask(MetadataSharingServiceImpl.java:199)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	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 $Proxy171.executeTask(Unknown Source)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	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.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy172.executeTask(Unknown Source)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	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 $Proxy172.executeTask(Unknown Source)
      	at org.openmrs.module.metadatasharing.task.TaskEngine$RunnableTask.run(TaskEngine.java:124)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: org.apache.commons.lang.NotImplementedException: Code is not implemented
      	at org.openmrs.api.impl.ConceptServiceImpl.saveConceptDatatype(ConceptServiceImpl.java:807)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	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 $Proxy128.saveConceptDatatype(Unknown Source)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	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.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy129.saveConceptDatatype(Unknown Source)
      	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)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	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 $Proxy129.saveConceptDatatype(Unknown Source)
      	... 60 more
      
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.invokeServiceSaveItem(OpenmrsClassScanner.java:265)
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.serviceSaveItem(OpenmrsClassScanner.java:174)
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:107)
      	... 53 more
      

      We definitely need to avoid calling this method.

      We should probably also avoid exporting ConceptDatatype in packages.

      And we should probably prevent the user from choosing to include them in a package in the UI.

      @Rafal, waiting for your suggestion about the best way to handle this.

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  darius Darius Jazayeri
                  Reporter:
                  darius Darius Jazayeri
                  Watchers:
                  Darius Jazayeri, Mark Goodrich, Rafal Korytkowski
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: