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

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

Do you have a pull request to reproduce this?

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

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

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

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

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

This could be helpful.

1 Like

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?

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

Regards

got it thank you

1 Like