while trying to backport TRUNK-5093 to 2.1.x I’ve encountered an exception in the MediaHandler class. I went on to test whether it also happens with the newest master and encountered it there as well. Here are the steps I took:
Pull newest openmrs-core master from GitHub
mvn clean install it to generate the .war
Deploy it on a newly created distribution server by calling mvn openmrs-sdk:deploy in the openmrs-core directory
Create a Test Patient and a Complex Obs concept that uses the MediaHandler
Save a Complex Obs with an mp3 file (I used the one that is in the resources folder)
So the FileInputStream cast of the ComplexObs data on line 100 of the MediaHandler causes this problem.
Can someone reproduce this? I’m a bit confused, as I’m pretty sure I haven’t had this error when I finished the TRUNK-5093 ticket for the master branch and tested it with the mp3 file. I will dig deeper to see where it comes from.
Previously I always tested openmrs-core .war files like this and never got this error. Are you sure this is not hinting at some problem? Regardless whether I could somehow make it work, I’m a bit worried about that.
For comparison, I also created a default 2.2.0 SNAPSHOT platform server via the openmrs-sdk (with openmrs-sdk:setup) and added the legacy-ui 1.4 for navigation. I did the same things and got the same error, so I can’t seem to find the problem, even though I did not deploy my own compiled openmrs-core. Since this server came purely from the openmrs-sdk, it should probably be reproducible.
I’ve now reinstalled the openmrs-sdk and created a Reference Application 2.9 SNAPSHOT server with it. Just running this completely unmodified server and doing the aforementioned steps via the legacy UI leads to the same exception for me. If there isn’t something completely wrong with my openmrs-sdk installation or database this should be reproducible. Can someone try it this way?
Sorry for the late reply! Did anything change in the last few weeks about OpenMRS core that could relate to it? If not, I checked it with a .war I compiled from the (then) current core master branch around the time I created the original post.