platform warning due to owa extension


when I run a current 2.2.0-SNAPSHOT of the platform using the openmrs-sdk I get

WARN - Module.expandExtensionNames(573) |2018-03-11 12:36:57,211| owa: Unable to create instance of class defined for extension point: org.openmrs.admin.list
java.lang.NoClassDefFoundError: org/openmrs/module/web/extension/AdministrationSectionExt
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(
	at Method)
	at org.openmrs.module.ModuleClassLoader.loadClass(
	at org.openmrs.module.ModuleClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at org.openmrs.module.Module.expandExtensionNames(
	at org.openmrs.module.Module.getExtensions(
	at org.openmrs.module.ModuleFactory.startModuleInternal(
	at org.openmrs.api.context.Daemon$
Caused by: java.lang.ClassNotFoundException: org.openmrs.module.web.extension.AdministrationSectionExt
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
	at org.openmrs.module.ModuleClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	... 16 more

which stems from the fact that the class


is in the legacyui and not in the platform.

Is this more than just a warning? Could it be an issue in the OWA? If the OWA needs the legacyui why do we ship it without?

The OWA module has two things. The API and a UI for managing open web apps. The UI requires the legacyui module. Without this UI, one can use the newly created addon manager to manage open web apps and hence not require the legacyui module. So the above is just a warning.

We should change our module loading code such that it doesn’t report a noisy message like this in the case of something that is expected behavior.

Simplistic approach is to just catch this error and do something like:

log.debug("$moduleName refers to missing extension class $classname.")

A bit nicer for the end user would be to special-case the classnames that used to be in openmrs-core and are now in the legacyui module and do something like:"$moduleName is trying to add an item to the legacy admin UI. If you want to see this, then install the Legacy UI module")

The correct fix would probably be to change the openmrs-core module framework to allow modules to indicate whether an extension is required or not (defaults to false), and so if a required extension is missing we should fail hard, but if it’s optional then we don’t need a noisy error message. (I do not think this is worth the effort.)

I see the same error (see below) when I try to start the Groovy module. The groovy admin links don’t appear on the old-school admin page. The Legacy UI module is installed and running. Create a ticket?

OpenMRS 2.1.3 Legacy UI Module 1.3.3 Groovy 2.2.4

WARN - Module.expandExtensionNames(575) |2018-08-14 17:38:02,378| groovy: Unable to find class definition for extension: org.openmrs.admin.list java.lang.NoClassDefFoundError: org/openmrs/module/web/extension/AdministrationSectionExt …

Yes create a ticket for the groovy module, which needs to be aware of the legacyui module in its config.xml