org.hibernate.HibernateException: Unable to locate named class org.openmrs.module.reporting.serializer.ReportingSerializer

Reporting module versions 0.9.7, 0.9.9 and 0.10.4 all tested and threw the same exception;

org.hibernate.HibernateException: Unable to locate named class org.openmrs.module.reporting.serializer.ReportingSerializer

when invoking into the report definitions as well as requests such as on these lines;

Context.getService(ReportDefinitionService.class).getAllDefinitionSummaries(false)

or

Context.getService(ReportService.class).getReportRequests(null, null, null, null);

@mseaton, any clue about this, am pretty sure that class exists

@k_joseph, in what context is this happening? Can you point me to the code in which this failure occurs, preferably in a unit test? Do you have the necessary require_module elements set up in your calling code to indicate a dependency on the reporting module within it’s classloader?

1 Like

o yeah, i have the required module, this is happening in https://github.com/rwanda-rbc-emr/openmrs-module-mohtracportal where we have a requirement to execute one report from another page outside reporting pages.

for-example at: https://github.com/rwanda-rbc-emr/openmrs-module-mohtracportal/commit/5e242b21b43cad97f0eccd5a6b3a3460b2afa723#diff-50660550a19dd0394987220d4f4fb4a7R218

@k_joseph can you reproduce this by simply setting up a new instance of the openmrs standalone with your custom modules?

if you can truncate your whole standalone database and i share a whole db with you, that way you can reproduce it with my modules otherwise you may fail to run some of my modules which require several metadata to run smoothly.

@k_joseph that does not answer my question. :slight_smile:

1 Like

so strange that i don’t get this same problem when making the same call within a unit test against the same database, i have uploaded the database at: https://goo.gl/A8FkSl @mseaton & @dkayiwa and written a complete fine unit test working well at: https://github.com/rwanda-rbc-emr/openmrs-module-mohtracportal/commit/77f0d897fcd7ef34f97817f969800adcfc99b4fc

@k_joseph i still maintain this question: can you reproduce this by simply setting up a new instance of the openmrs standalone with your custom modules?

i think you can.

full stack trace obtained: http://pastebin.com/F2DKFaYs thrown at: https://github.com/openmrs/openmrs-core/blob/1.11.5/api/src/main/java/org/openmrs/api/db/hibernate/HibernateSerializedObjectDAO.java#L148

@k_joseph are you sure you can, or are you just guessing? :smile:

i have not tested but you would only need to install mohtracportal-0.2.7-SNAPSHOT.omod htmlwidgets-1.7.2.omod, calculation-1.2.omod, serialization.xstream-0.2.7.omod, reporting-0.9.7.omod, rwandasphstudyreports-1.0-SNAPSHOT.omod and that should work, let me try it out now

If you are too busy to test that out, then i am too! :smile:

1 Like

now confirmed, you can run with the following modules;

mohorderentrybridge-1.0.2-SNAPSHOT.omod
serialization.xstream-0.2.7.omod
htmlwidgets-1.7.2.omod
calculation-1.2.omod
mohtracportal-0.2.7-SNAPSHOT.omod
rwandasphstudyreports-1.0-SNAPSHOT.omod
reporting-0.9.7.omod

However, now with the new standalone instance i don’t seem to reproduce this issue

What do you mean with the new standalone?

i mean after replacing standalone modules and running a fresh demo database; am sure it is not occurring here because of missing the necessary metadata and so i get no report definitions added to my database

Generally, you need to invest time in making it easy for others to help you, else you will have no other option but hassle it out on your own. In other words, you need to put down clear exact steps that any one willing to help, should do to reproduce this. For instance, what are the exact steps for one to reproduce this with the standalone? You need to be as specific as possible to the extent of mentioning the exact versions you are using for each and everything!

All metadata issues are avoidable by loading https://goo.gl/A8FkSl (~83MB) database into the standalone, here are my steps confirmed;

  1. Run a cloned standalone instance to replace its database data with the above database
  2. Log into MySQL and drop all tables, then run source /path/to/above/db.sql to recreate the database
  3. Replace all modules within the standalone appdata/modules folder with; mohorderentrybridge-1.0.2-SNAPSHOT.omod,serialization.xstream-0.2.7.omod,htmlwidgets-1.7.2.omod,calculation-1.2.omod,mohtracportal-0.2.7-SNAPSHOT.omod,rwandasphstudyreports-1.0-SNAPSHOT.omod,reporting-0.9.7.omod. The three custom modules from the list can be downloaded from: https://goo.gl/SqQ9ae (~7MB)
  4. Restart the standalone and after loading, access http://localhost:8081/openmrs-standalone/login.htm and first login then click home link at the top/header and you will be directed to a red letter coloured home page with the error. (the home/index file of OpenMRS is overwritten by a mohtracportal module welcome page and so since it is the page that fails with this error, you need to first login to avoid authentication issues which happen before redirection to the login page)

Is there any way of avoiding downloading the 83MB data? In other words, i already have the standalone locally. Since the report definitions that fail to load are automatically created by your module’s activator, can’t i have them automatically created in my local standalone? Is the metadata you are referring to automatically created by your custom modules?

the metadata unfortunately is not created by the custom modules and therefore the definitions are not added when the modules are loaded in a database where the metadata required is missing