TRUNK- 5499, Upgrading the Hibernate Library fails to build at Openmrs-api

Hello, After Upgrading the Hibernate Library with the following Sub Libraries

  1. org.hibernate:hibernate-c3p0 … 4.3.9.Final -> 6.0.0.Alpha2

  2. org.hibernate:hibernate-core … 4.3.9.Final -> 6.0.0.Alpha2

  3. org.hibernate:hibernate-ehcache … 4.3.9.Final -> 5.4.2.Final

  4. org.hibernate:hibernate-search-orm … 5.1.2.Final -> 5.11.1.Final

  5. org.hibernate:hibernate-validator … 4.2.0.Final -> 6.1.0.Alpha4

I run the mvn clean install , the build runs successfully for OpenMrs , openmrs-tools, and openmrs-test but then fails at openmrs-api.

The error points to this
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project openmrs-api: Compilation failure: Compilation failure:
[ERROR] /home/irynah/Openmrs-Projects/trunk-5491/openmrs-core/api/src/main/java/org/openmrs/notification/db/hibernate/[16,20] error: cannot find symbol
[ERROR] [ERROR] package org.hibernate [ERROR] /home/irynah/Openmrs-Projects/trunk-5491/openmrs-core/api/src/main/java/org/openmrs/notification/db/hibernate/[18,30] error: package org.hibernate.criterion does not exist [ERROR] [ERROR] /home/irynah/Openmrs-Projects/trunk-5491/openmrs-core/api/src/main/java/org/openmrs/notification/db/hibernate/[19,30] error: package org.hibernate.criterion does not exist
[ERROR] [ERROR] /home/irynah/Openmrs-Projects/trunk-5491/openmrs-core/api/src/main/java/org/openmrs/api/db/hibernate/[14,20] error: cannot find symbol

Here is the full error log

Please I need your guidance. cc @dkayiwa , @odorajonathan , @mozzy , @ruhanga

@irenyak1 the org.hibernate.criterion package is missing and its needed for a successful compilation in the api, try to include it in your build path because the compiler does see it

Thank you @irenyak1. You may also need to examine the dependencies for the libraries you are upgrading, see if they are already packaged in core. For example, for library upgrades 3 and 4, looking through the following or related links may be helpful.

Those would then help determine the version of hibernate-core you may start with.

1 Like

Sure @ruhanga I was actually looking at the same pages and I realized there are library versions I need to consider other than the ones listed on the talk post.

1 Like

So you may want to tryout with the required and available maven dependencies.

1 Like