Uploaded image for project: 'OpenMRS SDK'
  1. OpenMRS SDK
  2. SDK-244

SDK installs reporting-1.17.0.omod, which is too old for appointmentschedulingui-1.7.0 that it also installs

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • TBD
    • Resolution: Won't Fix
    • None
    • None
    • SDK
    • None
    • Undetermined

    Description

      As in the summary, the `appointmentschedulingui` installed by the SDK for a vanilla Distribution server depends on functionality not in `reporting` version 1.17.0, the version the SDK incorrectly installs.

      A longer Talk thread describing the issue is at https://talk.openmrs.org/t/25535.  Relevant portions are copied below:


      After installing the OpenMRS SDK:

      $ mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

      I created a new server:

      $ mvn openmrs-sdk:setup

      For the questions it asked, I chose

      • `1) Distribution`,
      • `2) Reference Application 2.9.0`,
      • the default ports,
      • `1) MySQL 5.6 (requires pre-installed MySQL 5.6)`,
      • the default database URI,
      • the root credentials for my MySQL instance, and
      • `1) JAVA_HOME (currently: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre)`.

      I then started the server:

      (cd ~/openmrs/server; mvn openmrs-sdk:run -DserverId=server)

      After visiting http://localhost:8080/openmrs/ in my browser and waiting for the install to complete, I logged in using the credentials `admin`/`Admin123`. I then clicked "Appointment Scheduling" and saw the menu for scheduling appointments.

      Back in my shell, I pressed control-C to kill the server. Without doing anything else, I then restarted it:

      (cd ~/openmrs/server; mvn openmrs-sdk:run -DserverId=server)

      After visiting <http://localhost:8080/openmrs/ in my browser, I logged in using the credentials `admin`/`Admin123`. I then clicked "Appointment Scheduling" and saw this error message instead:

      org.openmrs.ui.framework.UiFrameworkException: viewProvider appointmentschedulingui does not have a view named home
      {{ at org.openmrs.ui.framework.page.PageFactory.getView(PageFactory.java:295)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:183)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:116)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:86)}}
      {{ at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:116)}}
      {{ at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:83)}}
      {{ ...}}

      Meanwhile, the following is visible in my shell:
      {{ WARN - OpenmrsClassLoader.expandURL(800) |...| Cannot find jar at: /home/user/openmrs/server/.openmrs-lib-cache/appointmentschedulingui/appointmentschedulingui.jar for url: jar:file:/home/user/openmrs/server/.openmrs-lib-cache/appointmentschedulingui/appointmentschedulingui.jar!/web/module/pages/home.gsp}}
      {{ WARN - OpenmrsClassLoader.expandURL(800) |...| Cannot find jar at: /home/user/openmrs/server/.openmrs-lib-cache/appointmentschedulingui/appointmentschedulingui.jar for url: jar:file:/home/user/openmrs/server/.openmrs-lib-cache/appointmentschedulingui/appointmentschedulingui.jar!/web/module/pages/home.gsp}}
      {{ ERROR - PageController.handlePath(155) |...| viewProvider appointmentschedulingui does not have a view named home}}
      {{ org.openmrs.ui.framework.UiFrameworkException: viewProvider appointmentschedulingui does not have a view named home}}
      {{ at org.openmrs.ui.framework.page.PageFactory.getView(PageFactory.java:295)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:183)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:116)}}
      {{ at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:86)}}
      {{ at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:116)}}
      {{ at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:83)}}
      {{ ...}}
      Indeed, the folder `/home/user/openmrs/server/.openmrs-lib-cache/appointmentschedulingui` is empty.

      In the log message from the second run of the server there is this tidbit:

      org.openmrs.api.db.DAOException: Unable to deserialize object: Serialized org.openmrs.module.appointmentscheduling.reporting.dataset.definition.AppointmentDataSetDefinition named <appointmentschedulingui.appointmentDataSetDefinition.dailyAppointments>
      {{ at org.openmrs.api.db.hibernate.HibernateSerializedObjectDAO.convertSerializedObject(HibernateSerializedObjectDAO.java:302)}}
      {{ at org.openmrs.module.reporting.definition.service.SerializedDefinitionServiceImpl.getDefinitionByUuid(SerializedDefinitionServiceImpl.java:123)}}
      {{ ...}}
      {{ Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.openmrs.module.reporting.common.SortCriteria$SortElement as it does not have a no-args constructor : Cannot construct org.openmrs.module.reporting.common.SortCriteria$SortElement as it does not have a no-args constructor}}
      {{ ...}}

      where `org.openmrs.module.reporting.common.SortCriteria$SortElement` suggests looking in https://github.com/openmrs/openmrs-module-reporting, and, indeed, the latest version has the missing no-args constructor.

      So after

      $ mkdir -p ~/git
      {{ $ cd ~/git}}
      {{ $ git clone https://github.com/openmrs/openmrs-module-reporting.git}}
      {{ $ cd openmrs-module-reporting/}}
      {{ $ mvn package}}
      {{ $ rm ~/openmrs/server/modules/reporting-1.17.0.omod}}
      {{ $ cp ./omod/target/reporting-1.20.0-SNAPSHOT.omod ~/openmrs/server/modules/}}
      I am able to run the Distribution server without issues.

      Gliffy Diagrams

        Attachments

          Activity

            People

              Unassigned Unassigned
              bradyds Brady G
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: