Upgrade of webservices.rest from 2.13 to 2.23.0 causes spring issues in the idgen module

Hey,

I’m working on IDGEN-42. Where we added Identifier resources and their handlers in the idgen module. That being said, we have to also add support for swagger to fully document these resources. That invoked to me to do upgrade to webservices.rest 2.23.0 however this upgrade caused this error

Full log : https://pastebin.com/32wuu5TH

Failing bean: https://github.com/openmrs/openmrs-module-webservices.rest/blob/2.23.0/omod-common/src/main/java/org/openmrs/module/webservices/rest/InitPathMatcher.java#L32

PR : https://github.com/openmrs/openmrs-module-idgen/pull/74

Does this require a spring/platform upgrade? Could someone please help me out here. This is a community priority ticket :wink:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initPathMatcher': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List org.openmrs.module.webservices.rest.InitPathMatcher.handlerMappings; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in class path resource [openmrs-servlet.xml]: Initialization of bean failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304) ... 31 more Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List org.openmrs.module.webservices.rest.InitPathMatcher.handlerMappings; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in class path resource [openmrs-servlet.xml]: Initialization of bean failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282) ... 45 more

cc: @dkayiwa, @darius, @wyclif, @mogoodrich

I have increased the version in this commit: https://github.com/openmrs/openmrs-module-idgen/commit/3ce39e786461ffc7b2373c3642eda140e2dc2707