Basic Module Error Starting

Hi,

I’m trying to follow the “Creating Your First Module” training article here Creating Your First Module - Documentation - OpenMRS Wiki. But before I start modifying it, I decided to try out first the Basic Module as it is. So I went and hit “run” on the build.xml file, got the .omod file from the dist folder, then uploaded it via my OpenMRS Manage Modules interface. I’m using the Ref App 2.5. I didn’t change anything in the files.

It loaded but there was an error starting. It says “Error while trying to start module Unable to load/find moduleActivator: ‘org.openmrs.module.growthchart.GrowthChartActivator’ Module: Growth Chart Module”

But I double checked the config.xml file as well as the directory to see if the activator was indeed there - they all seem to be ok in place.

Am I missing something? I’ve tried building and rebuilding a couple of times and reuploading but still not working.

Here’s a screenshot of the config.xml and project directory showing that the activator file (see left bar) is in place:

If you change your module activator from implements Activator to extends BaseModuleActivator and compile again, all will be well. By the way, have you seen this? https://wiki.openmrs.org/display/docs/OpenMRS+SDK

Hi thank you so much for your reply. I tried doing that, modified GrowthChartActivator.java and replaced the implements Activator with extends BaseModuleActivator but when I tried uploading in openMRS I got this:

Sorry as I’m really new to Java and still trying to learn it (I’m used to microcontroller programming so Java and this whole web dev thing is somewhat new to me). I saw that SDK thing before but I really couldn’t figure out how it plays out in the big picture of what I’m trying to achieve and a bit overwhelmed with the numerous options available (haha)

Can you publish your module on github and a i take a look?

These instructions are outdated.

@giasantos, I completely agree with you that the SDK has tons of options, and if you don’t know where to look, the docs are overwhelming. But you really should use it instead of the instructions you’re following. You specifically want to look at Creating Projects there: https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Creatingprojects

@dkayiwa, I suggest that instead of taking a look at giasantos’s module code right now, we should:

  1. find all remaining pieces of documentation that talk about the basic module, and replace them with references to the SDK.
  2. update this Step By Step Tutorial so that it describes how to build your first module, in an accessible way.

Hi, thank you very much for this! Checking the Creating Projects now under the SDK documentation!