FHIR OAuth Smart Apps Integration and OAuth module enhancements Updates

This thread concerns all project updates.

Here’s the link for the project here

@maany @harsha89

Resource Pool for the project can be found here

A demo of how Spring Security 4 works with Java 8 and implements OAuth. https://github.com/mavrk/SpringOAuth2Example using the Annotation Model.

1 Like

Hey @maany, In case you were looking at the example I was working on, please look again. There was a bean error when I used @Autowire but now it’s resolved.

sure thing @mavrk! It’s looking good thus far.

I am playing around with the functionality right now and working on more REST endpoints. I’ll push changes as I make some progress :slight_smile:

Hey @maany I am back from that 3 day vacation I told you about, I am currently working on migrating a Spring 3 MVC project to Spring 4 and Annotation based model. I’ll ping you if I face any troubles :slight_smile:

1 Like

@mavrk Great. Since we are in the official coding period, I would recommend that you push your code everyday and share the link of the repo here. Also, as we discussed, the key to a successful project is communication. So do push your blockers to me or @harsha89 or ask them on the irc channel. Also, participate in the [Daily Scrum meetings] (https://wiki.openmrs.org/display/RES/Daily+Scrum+Meeting) if possible.

Feel free to ping me otherwise too :wink:

Also, the module is almost ready for you to start coding ( you could actually begin the migrations, there’s just one bug which will automatically get resolved as we move to Hiberbate 4.x.). In the meantime, to satiate my perfection cravings, I’ll find a workaround and move the repo to openmrs github organization. But that should not keep you from creating JIRA issues and sending the PR’s :slight_smile: Good Luck! \m/

1 Like

Hi @Mayank, there’s a problem which is troubling me. The class AdminList.java (here) extends the class AdministratorSectionExt class which is removed in OpenMRS 2.x I am trying a few things to get past this problem. However, if you have any idea what should be done, please help :slight_smile:

Did you try doing the following:

Hi @dkayiwa, thanks for the help. However, I am still getting the same error “Error while trying to start module org.openmrs.module.oauth2.extension.html.AdminList cannot be cast to org.openmrs.module.Extension”

This is the stack trace

WARN - ModuleFactory.startModuleInternal(788) |2017-06-07 22:04:17,650| Error while trying to start module: oauth2
java.lang.ClassCastException: org.openmrs.module.oauth2.extension.html.AdminList cannot be cast to org.openmrs.module.Extension
        at org.openmrs.module.Module.expandExtensionNames(Module.java:539)
        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)

Did you remember to put the provided scope on your legacyui module dependency?

1 Like

Yes I did that

Can i look at your module source or its compiled omod?

1 Like

That error was resolved, and the module loads but I still get an exception while trying to run it

Exception in thread "Thread-71" 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(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:637)
        at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:556)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        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-72" 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)

And a big thank you for your help :slight_smile:

Here’s the tomcat logs https://pastebin.com/7A02pPfu

This is my code https://github.com/mavrk/openmrs-module-oauth2-prototype/tree/oauth2-openmrs-2.x

@maany@dkayiwa Any help is HIGHLY appreciated :wink:

Are all your changes committed. I get a different error about uuid mapping for Client.

Yes, all of my changes are commited, I am running this against the OpenMRS 2.0.1 war file.

Can you start by fixing this error? “Caused by: org.hibernate.MappingException: Duplicate property mapping of uuid found in org.openmrs.module.oauth2.Client”

This could be of help: https://issues.openmrs.org/browse/CSM-111

Thanks I’ll take a look at it :slight_smile: