java.lang.IllegalStateException: Two resources with the same name (v1/visitdocument) must not have the same order

Hi I am using visitdocumentsui module for uploading and getting exception

java.lang.IllegalStateException: Two resources with the same name (v1/visitdocument) must not have the same order at at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint( at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( at org.openmrs.aop.LoggingAdvice.invoke(

Hi @mukesh, could you provide more details on how you got there? Which version of the Ref App distribution are you seeing this on? Did you install any other modules, and if yes, which ones? Which version of Visit Documents UI have you installed? You need to provide a little bit more context for others to understand what exact steps lead to this error.

I am using VisitDocumentsUI 2.0 and integrating with my custom module.I am integrating visidocumentui using url on gsp page.

The error stated is:

Did you by any chance add a resource with the same name and the same order in your custom module?

You would have to provide a lot more details than this for us to be able to help you. Pointing to the repo of your custom module for instance would be a start. And also describe detailed steps as to what you did exactly.

privous problem is solved.The main cause of privious problem is I have not injected dependency in pom.xml of custom module.Ryt now I am facing problem that upload option is not displaying on the page.

@mukesh its not very clear how you got over this .Running into the same issue with web.restservices module after introducing a new property to the TaskAction Resources getTaskActionByUuid

Ref :

For anyone who may run into a similar issue in the future

My issue had risen from extending TaskActionResource1_8 as below

@Resource(name = RestConstants.VERSION_1 + "/taskaction", order = 2, supportedClass = TaskAction.class, supportedOpenmrsVersions = {
        "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*", "2.4.*" })
public class TaskActionResource2_4 extends TaskActionResource1_8 implements Creatable {

Issue disappeared by adding order = 2 to the @Resource Signature as above

1 Like