FHIR OAuth Smart Apps Integration and OAuth module enhancements Updates

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?

Which platform version are you running this on? If 2.x, did you add the aware of element? https://github.com/openmrs/openmrs-module-xforms/blob/master/omod/src/main/resources/config.xml#L28

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.

Thanks for the help :slight_smile: You are awesome :sweat_smile:

1 Like

@dkayiwa Can you look at this? https://pastebin.com/gPi2vUhB

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'.

I am getting this error against this branch.

@mavrk pretty sure the new xsd version you refers to a broken link Try to open this link in your browser.

Can you re-check the url :slight_smile:

Still no luck!! I am getting the same error :disappointed_relieved:

@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 :slight_smile:

Hi @maany, good news is that exception about XML parsing is resolved. Bad news is now I am getting bean creation errors. :persevere:

Here’s the logs https://pastebin.com/CvGYFmDV

Root cause is java.lang.ClassNotFoundException: org.springframework.security.oauth2.provider.token.JdbcTokenStore

1 Like

yes I got rid of that problem, but beans are still not created. I am looking into it. I am positive, I think I’ll fix it :slight_smile:

Anyways, thank you sooooo much for all your support. You guys are amazing :blush:

@mavrk We’ll be discussing these over a call today :slight_smile:

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.

Here’s the link to tomcat logs https://pastebin.com/s2iW0i5R

Look at this section of your log https://pastebin.com/jWDZZrBE

@dkayiwa @maany Any idea why am I getting this exception?

org.openmrs.PersonName is not an indexed entity or a subclass of an indexed entity

@mavrk are you getting this while writing the new REST Controller(Platform 1.11.4) or while working on module migration (Platform 2.x) ?

The module migration

@mavrk I’ll need more info. Can you attach the stack trace too.


Are you available for a call tomorrow. Around 10 p.m IST? You can work on the controller until then :slight_smile:

1 Like