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:

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: and remove this:

(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 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\omod\target .


(Jacinta Gichuhi) #11

got it thank you