I was getting back at doing some Angular development within the Ref App and I put my module under watch leveraging the SDK as usual.
However I realised that the Angular views, that we put under omod/src/main/webapp/resources/partials are not hot redeployed when saving them while being under watch.
I am almost positive that this used to work but I’m picking work two months after the last time I’ve done such things.
I am now on SDK 3.8.1, @mksrom who uses 3.5.0 faces the same issue.
Obviously this is making any changes in the views really cumbersome and time consuming, I’m sure I must be missing/forgetting something.
But the weird thing is that it fails only with partials.
GSP fragments, JS files, all those are correctly hot redeployed upon saving. It’s just those HTML files within partials that aren’t redeployed.
Actually this has become less urgent as I’m using the following workaround:
I copy the content of my HTML partial into a GSP file that is in webapp/pages/templates. Then I make my Angular directive temporarily point to the corresponding .page file.
This allows me to do the client-side development with hot redeployments. When I’m finished, I copy back the content of the GSP file into the HTML original partial file, delete the GSP file and then revert the templateUrl change in the directive.
Not ideal… but it allows me to get going.
So we would love to find a solution with the partials but you can definitely look at it at a later time if that’s more convenient for you. I understand that you must be quite busy with this Nexus migration… etc.
Thanks anyway for being on the fence, really appreciated.
I have the impression that it does not only affect partials. I’m finding myself more and more in situations where I can’t reliably trust that the client-side resources have been reloaded. I can’t quite put my finger on it though.
This is happening when debugging a distro using UI Framework 3.4.
I tried to reproduce the issue yesterday, but for some reason whenever I installed the visitdocumentsui module it broke the server for me with “could not find referenceapplication provider”… I’ll pick it up today again…
Meanwhile, did you try using ctrl+f5 to force the browser to reload all page resources? There’s also Disable cache options in Chrome developer tools, which you can use instead. Let me know if it helps.
Weird, I could install our version 1.2-SNAPSHOT on qa-refapp (the old school way of course, through module administration.)
Look at patient 10H71 for instance.
Strange indeed, I get the following exception when starting up the server with module loaded. I’ll check if the same happens when I load it manually after server is started…
Exception in thread "Thread-8" java.lang.NoClassDefFoundError: org/springframework/mock/web/MockMultipartFile
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:490)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1057)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1030)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:842)
at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:866)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:658)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:637)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:268)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
Caused by: java.lang.ClassNotFoundException: org.springframework.mock.web.MockMultipartFile
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:563)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more
Ok sorry, you would have to pull and clone the tip of the dev branch now (the default one). What you see was an error that I cleared a little while ago while developing.