Unable to access ReportDefinitionService from reporting module

Application Name: OpenMRS Reference Application Version Number: 2.3

Question: I am trying to use some methods from reporting module in dhisreport module. I am trying to display a set of report definitions similar to this ReportListController. I have included reporting version 0.9.8 in the pom of my module.

But, I am getting an error - java.lang.ClassNotFoundException: org.openmrs.module.reporting.report.definition.service.ReportDefinitionService. I have tried restarting the server, but, didn’t help.

The stacktrace for the problem is - http://pastebin.com/gBmW7AEu

@mseaton, @dkayiwa, @wyclif any thoughts?

Offhand I’d say:

  1. Make sure you have scope=provided when adding reporting-api to your pom
  2. Make sure to declare a module dependency in your config.xml
1 Like

Thank you @darius, Had the module, had the dependency in pom was able to access the method using intelliSense

Didn’t have required tag in config - had a different (0.9.7) version installed instead of the latest. That gave the error.

To clarify what Darius is saying, your module also needs to declare the reporting module as a required module in the config.xml file because it’s what makes reporting classes visible to your module’s classloader, can you confirm that?

yes @wyclif that was the error. making it required solved my NoClassDefinitionFound Error.