error overriding getGETModel() and getCREATEModel() in openmrs module resource


(Jacinta Gichuhi) #1

i’m getting the following error when i override the above methods Exception in thread “Thread-11” java.lang.LinkageError: loader constraint violation: loader (instance of org/openmrs/module/ModuleClassLoader) previously initiated loading for a different type with name “io/swagger/models/Model”

full error log: https://pastebin.com/HcRWC5g9

I have checked that i have added same required swagger dependancies versions and imports as those in the webservises rest.

@dkayiwa @rickysilas


(Daniel Kayiwa) #2

Do you have a pull request to reproduce this?


(Jacinta Gichuhi) #3

here is a link to my module, maybe you can get the omod and try it out

I have a sub class handler here for ProcedureOrder in the resources folder which is causing the error in its getGETModel() and getCREATEModel() overridemethods


(Daniel Kayiwa) #4

Change the scope from compile to provided for this: https://github.com/jecihjoy/openmrs-module-orders/blob/master/omod/pom.xml#L56 and remove this: https://github.com/jecihjoy/openmrs-module-orders/blob/master/omod/pom.xml#L63-L67


(Jacinta Gichuhi) #5

for a start the error is gone, thank yu soo much


(Jacinta Gichuhi) #6

Hello after running mvn clean install in the openmrs web rest, where can I locate the omod file?


(vino siva) #7

I think you have to locate omod file in .OpenMRS/modules folder


(Nathan Ruhanga) #8

This could be helpful.


(Jacinta Gichuhi) #9

i have made some changes here https://github.com/openmrs/openmrs-module-webservices.rest and i want to generate an omod file, after running mvn clean package where do i look fo the omod file?


(Nathan Ruhanga) #10

The resource I linked you to defines it to be found here openmrs-module-webservices.rest\omod\target .

Regards


(Jacinta Gichuhi) #11

got it thank you