However @dkayiwa, on my machine,I am getting this error while trying to start the module after loading it.
Exception in thread "Thread-323" java.lang.LinkageError: loader constraint violation: loader (instance of org/openmrs/module/ModuleClassLoader) previously initiated loading for a different type with name "org/openmrs/module/Extension$MEDIA_TYPE"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:637)
at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:556)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.openmrs.module.oauth2.extension.html.AdminList.getMediaType(AdminList.java:32)
at org.openmrs.module.Extension.getExtensionId(Extension.java:123)
at org.openmrs.module.Module.expandExtensionNames(Module.java:543)
at org.openmrs.module.Module.getExtensions(Module.java:490)
at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:664)
at org.openmrs.api.context.Daemon$1.run(Daemon.java:74)
Exception in thread "Thread-327" java.lang.LinkageError: org/openmrs/module/Extension$MEDIA_TYPE
at org.openmrs.module.oauth2.extension.html.AdminList.getMediaType(AdminList.java:32)
at org.openmrs.module.Extension.getExtensionId(Extension.java:123)
at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:666)
at org.openmrs.api.context.Daemon$1.run(Daemon.java:74)
Any idea why am I getting this error? Or any suggestion at all?
I looked at the classes and removed a method which was being overridden. That solved the problem for now. Now, I am stuck at an XML parsing exception, which I am resolving.
HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 162 in XML document from URL [jar:file:/F:/GSoC/openmrs-standalone-2.5/openmrs-standalone-2.5/appdata/.openmrs-lib-cache/oauth2/oauth2.jar!/webModuleApplicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 162; columnNumber: 64; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'oauth:resource-server'.
@mavrk I’ll build the module and check. Currently away from laptop. In the meantime you could remove the tag and use the @ResourceServer annotation as you move on towards migrating other parts to 2.0
Hi @maany@dkayiwa,
I have resolved some problems since our call last night. However, now I am getting errors creating beans in applicationContext-Service.xml file which is NOT part of the OAuth2 Module. It’s part of the OpenMRS Core.