Hi,I am injecting maven dependency of spring-websocket in my custom module which is using openmrs-2.0.6.My module compile successfully but when I start openmrs application ,openmrs throws java.lang.ClassNotFoundException: org.springframework.web.socket.config.annotation.WebSocketConfigurer execption after refreshing context.Please someone suggest me what I am missing while injecting the dependency.
<description>API project for Notification</description>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-messaging -->
Those libraries are not include by openmrs core, therefore you need to ship them with your module by removing scope provided
Thank wyclif for reply.When I removed scope provided I am getting following error
Unable to refresh the spring application context. Root Cause was:
org.springframework.beans.FatalBeanException: Class [org.springframework.context.config.ContextNamespaceHandler] for namespace [http://www.springframework.org/schema/context] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
WARN - Listener.performWebStartOfModules(700) |2018-09-27 10:15:51,319| caught another error:
org.openmrs.api.APIException: Service not found: interface org.openmrs.scheduler.SchedulerService
I know this is childish question but I am struck and tried a lot of thing to resolve this issue.But I am not able to resolve.Please assist me what the problem.
Can you paste the entire log at pastebin.com?
Do you have the legacyui module installed and running?
Yes legecyui is installed and running successfully ,If I removed spring-websocket dependencies then my application up and run successfully but when I add spring-websocket dependencies then I get above mentioned error.If required I will share module pom file to you.
Is the module somewhere like on github for me to try it out?
Sure … Following is the link where I committed module https://github.com/mukesh-joomindia/openmrswebsocket
I’ve seen that issue before and it can be annoying to fix, it normally has to do with the fact that you have some duplicate spring jars files and the culprit most likely being spring-context, I think those 2 extra spring dependencies you are adding from your modules are pulling it in transitively, you will need to use the maven dependency tree plugin to identify which one is including it so you can exclude it.
BTW, in the IDE you should be able to quickly look at the jar files on the classpath and confirm if actually you have multiple versions of spring-context.