Skip to content

FLAG-87: Complete Configuration to Platform 2.8/Java 21 (Resolves All Compiler Issues)#104

Open
Abhxay wants to merge 13 commits intoopenmrs:masterfrom
Abhxay:feature/final-flag-87-fix
Open

FLAG-87: Complete Configuration to Platform 2.8/Java 21 (Resolves All Compiler Issues)#104
Abhxay wants to merge 13 commits intoopenmrs:masterfrom
Abhxay:feature/final-flag-87-fix

Conversation

@Abhxay
Copy link

@Abhxay Abhxay commented Oct 31, 2025

Module now targets OpenMRS Platform 2.8.0 and successfully compiles using Java 21.

Key Configuration Fixes 1. Dependency Management: Added maven-parent-openmrs-module:1.1.0 and explicitly defined required module versions to resolve "version is missing" errors. 2. Java 21 Compliance: Upgraded to 1.18.30 and configured maven-compiler-plugin to target Java 21. 3. Testing Bridge: Added necessary test dependencies (spring-test, junit-vintage-engine) to link JUnit 4 tests to the modern Java 21 runtime.

The build currently fails test execution (even with the vintage engine) due to incompatibility with libraries like PowerMock. This requires a dedicated PR to refactor all static mocks using modern Mockito methods.

@Abhxay Abhxay force-pushed the feature/final-flag-87-fix branch from 85863a4 to 2e36195 Compare October 31, 2025 13:53
@wikumChamith
Copy link
Member

@Abhxay
Copy link
Author

Abhxay commented Nov 14, 2025

@Abhxay did you get a chance to take a look at these?

https://github.com/openmrs/openmrs-module-htmlformentry/pull/320/files

https://openmrs.atlassian.net/jira/polaris/projects/OMRS/ideas/view/3970978?selectedIssue=OMRS-341

Action Required: New JIRA Issue

I have finalized and pushed the solution for the Configuration Phase (PR #104). The project now compiles successfully against Java 21.

The next major task is the Test and Code Refactoring required to achieve full Java 21 compatibility. Please create a new JIRA issue for the following work:

Refactor API/FHIR Tests: Migrate PowerMock to Mockito and Resolve Deprecations.

Abhxay and others added 5 commits November 14, 2025 16:58
- Added HibernateFlagDAO to verify SessionFactory interactions.
- Configured ByteBuddy and hbm2ddl.auto in test-hibernate.cfg.xml.
- Simplified TestingApplicationContext.xml to fix circular bean errors.
- Fixed dataset sequencing (Person before Patient) in flagtest-dataset.xml.
- Current Blocker: NoSuchTableException for patientflags_flag during FlagTest.
@Abhxay
Copy link
Author

Abhxay commented Jan 15, 2026

PR Status Update: Java 21 & Platform 2.8.0 Migration
I have completed the core structural updates for the Java 21 migration, but I am currently blocked by a persistent NoSuchTableException for the patientflags_flag table during unit tests.

Completed Fixes:
Java 21 Compatibility: Added the ByteBuddy bytecode provider to test-hibernate.cfg.xml and configured the Maven Surefire plugin to use the ByteBuddy agent to prevent proxying errors.

Referential Integrity: Updated the XML dataset sequencing (ensuring Person and Metadata precede Patient and Concepts) to fix previous IntegrityConstraintViolation errors.

DAO Layer: Updated HibernateFlagDAO to use DbSessionFactory in alignment with Hibernate 5 requirements for Platform 2.8.0.

Current Blocker:
Despite including the module mappings in test-hibernate.cfg.xml and setting hibernate.hbm2ddl.auto to update, the H2 in-memory database is not generating the module tables during the BaseModuleContextSensitiveTest execution.

Error logs:
Plaintext

org.dbunit.dataset.NoSuchTableException: patientflags_flag
at org.openmrs.test.BaseContextSensitiveTest.executeDataSet(BaseContextSensitiveTest.java:723)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants