java.lang.IllegalStateException: Failed to load ApplicationContext


I have Travis build failing tests from this PR I made.

java.lang.IllegalStateException: Failed to load ApplicationContext this comes after upgrading core to facilitate the use of DbSessionFactory and DbSession to bridge the Hibernate 3 vs. 4 differences

Any help with this @dkayiwa @mozzy @herbert24

was this passing locally??

Same error locally

As the first step, you will need to remove that private getCurrentSession() method which uses reflection.

@dkayiwa To accurately answer @herbert24 this is pastebin log error i actually get without removing the private getCurrentSession() method

Have you looked at all the pom files and confirmed that the OpenMRS platform versions are the ones you would expect?

Yes the pom file has platform version as 1.9.9 since I upgraded it from 1.9.4

Have you checked all the pom files to confirm that there is no other platform version?

The platform version in the api-1.10/pom.xml file points to 1.10.0 , see here

Does that version support what you are trying to do?

I have changed the platform version to 1.10.2 as 1.9.9 caused some errors in both pom files, and it builds perfectly

I would not recommend changing 1.9.x to 1.10.x because it may result into runtime problems for those who intend to run the module on 1.9.x but are not ready to upgrade to 1.10.x

There must have been a reason for the module to have the two versions that you found.

Yes I agree, I tried building it over platform versions after 1.10.2 and they all resulted to compilation errors, using 1.9.x also resulted into a compilation error

Changing the platform version only to 1.10.2 builds successfully. I referenced the support versions for the module from here

Did you try changing both versions by only changing the last digit of the version number?

No i haven’t tried that, but do you mean on the same version series 1.9.x because 1.9.9 is the only support version of that series for DbSessionFactory class

Is there any reason why you fear trying it out before asking?

@dkayiwa I upgraded core in the pom.xml to 1.9.9 from 1.9.4 and api-1.10/pom.xml to 1.10.2 from 1.10.0 and it works fine, I hope that should work to keep the two versions as you recommended.

That is exactly what i wanted you to do.