Question:
I am trying to install custom HTML forms when a module starts using the Metadata Deploy module, but on startup the module fails with the error java.util.zip.ZipException: invalid code lengths set. The log details can be found here:
@gwasilwa, first thing you should do is to go into the built omod (eg. in your omod/target/xyz.omod file, and to find the zip file in question that you are packaging in there. If this zip file fails to open, then you know it is ending up corrupted, and it is not a problem in loading it within openmrs.
One common pitfall I have seen is that, during the build process, we run a filter on all xml and properties files in order to do variable replacement. (eg. it allows you to refer to @MODULE_PACKAGE@ rather than “org.openmrs.module.mymodule” in your resources). Check to make sure that this is not affecting your files during the build process. It will look something like this within the “build” element in your pom.xml most likely:
Thanks @mseaton, your suggestion helped me through the first error.
Now I’m getting java.lang.ClassNotFoundException: org.openmrs.ConceptWord which is true since ConceptWord doesn’t exist in OpenMRS v1.11.2. Does this mean that I can only use the metadatadeploy with lower version of OpenMRS only?
I doubt this has anything to do wtih metadatadeploy. How exactly are you installing Concepts? Are you importing your htmlforms via metadatasharing and pulling Concepts within those MDS packages?
@gwasilwa, what version of OpenMRS was this MDS package (HTML_Forms-1.zip) created with? If you extract this zip file and grep it, do you see any references to concept word? If the MDS package was created with an earlier version of OpenMRS, and if this pulls in concept word entries, then this is likely causing your problem…
@ningosi, I believe the issue is that you are still doing the broad filtering in either your api pom, your omod pom, or both. Try removing the resource filtering from these poms unless they are doing something more than what you are doing in the top-level pom.