OSGI Version Upgrade (support building on JDK 17 and JDK 21)
Problem
Add support to building APIM on JDK 17 and JDK 21
Solution
OSGI Version Upgrade
Affected Component
APIM
Version
No response
Implementation
No response
Related Issues
No response
Suggested Labels
No response
[UPDATE]
I have successfully built the caron-kernel 4.9.x branch using JDK 17, after resolving the issues that arose during the process. Next, I built the carbon-apimgt branch with the new carbon-kernel version and the new version of axis2, after addressing the encountered issues. I am currently working on resolving OSGI issues while building the product-apim branch with JDK 17 and the aforementioned new versions.
[STATUS UPDATE]
I am still working on resolving OSGI issues in product-apim build that arose after upgrading the kernel and carbon-apimgt versions, which were built with JDK 17.
I was able to resolve the following issues in respective components to achieve a successful build status:
P2 plugin requires the Provide-Capability tag to be added to the manifest file of the bundle when an OSGi service is provided from the bundle. However, when the service is registered dynamically, this tag is not automatically added. To overcome this issue, I manually added the following classes to the corresponding components:
-
carbon-identity-framework:
-
org.wso2.carbon.identity.organization.management.service.OrganizationUserResidentResolverService -
org.wso2.carbon.consent.mgt.core.ConsentManager -
org.wso2.carbon.identity.application.authentication.framework.ApplicationAuthenticator -
org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService -
org.wso2.carbon.identity.functions.library.mgt.FunctionLibraryManagementService -
org.wso2.carbon.identity.user.profile.mgt.association.federation.FederatedAssociationManager -
org.wso2.carbon.idp.mgt.IdpManager -
org.wso2.carbon.identity.core.util.IdentityCoreInitializedEvent
-
-
carbon-governance:
-
org.wso2.carbon.registry.common.AttributeSearchService -
org.wso2.carbon.registry.indexing.service.ContentSearchService -
org.wso2.carbon.registry.indexing.service.TermsQuerySearchService -
org.wso2.carbon.registry.indexing.service.TermsSearchService
-
Additionally, I made the required changes for identity-carbon-auth-saml2, identity-governance, identity-inbound-auth-oauth, and carbon-commons to resolve the issues that arose from these dependencies.
[STATUS UPDATE]
Added the required dependency version upgrades for the following branches so far. Some OSGi issues are still required to be fixed while building the product-APIM.
The affected branches are:
- identity-governance
- carbon-registry
- carbon-identity-framework
- maven-tools
- identity-inbound-auth-oauth
- identity-organization-management
- identity-event-handler-notification
- identity-event-handler-account-lock
- wso2-axis2-transports
[STATUS UPDATE]
In progress building product APIM branch with JDK17, resolving the missing classes by adding the provide-capability tag to the identified code repositories.
Tracked all the changes and PRs in [1].
[1] https://docs.google.com/spreadsheets/d/1ElOQFXoS1D6lSlxS_ROChEvBspTlgK0byhvkTerOEUQ/edit?usp=sharing
[STATUS UPDATE]
- Fetched all the PR changes sent by Yasas and built all the components.
- Faced an issue when building the maven-tools repo due a missing package. Had to change the import statement to add the proper package.
- Currently, facing an issue as follows when building the product-apim repo.
Cannot complete the install because one or more required items could not be found.
Software being installed: WSO2 Carbon - Api Management Feature 9.29.160.SNAPSHOT (org.wso2.carbon.apimgt.feature.group 9.29.160.SNAPSHOT)
Missing requirement: org.wso2.carbon.apimgt.impl 9.29.160.SNAPSHOT (org.wso2.carbon.apimgt.impl 9.29.160.SNAPSHOT) requires 'java.package; org.eclipse.osgi.services [3.12.0,3.13.0)' but it could not be found
Cannot satisfy dependency:
From: WSO2 Carbon - Api Management Feature 9.29.160.SNAPSHOT (org.wso2.carbon.apimgt.feature.group 9.29.160.SNAPSHOT)
To: org.eclipse.equinox.p2.iu; org.wso2.carbon.apimgt.keymanager.feature.group [9.29.160.SNAPSHOT,9.29.160.SNAPSHOT]
Cannot satisfy dependency:
From: WSO2 Carbon - Api Management Key Manager Feature 9.29.160.SNAPSHOT (org.wso2.carbon.apimgt.keymanager.feature.group 9.29.160.SNAPSHOT)
To: org.eclipse.equinox.p2.iu; org.wso2.carbon.apimgt.impl [9.29.160.SNAPSHOT,9.29.160.SNAPSHOT]
[STATUS UPDATE]
- Removed the
org.eclipse.osgi.servicesfrom the relevant repos. This solved the issue mentioned above. But need to verify whether that jar is required. - Proceeding forward, faced several issues as shown below.
Missing requirement: org.wso2.carbon.apimgt.broker.lifecycle 9.29.160.SNAPSHOT (org.wso2.carbon.apimgt.broker.lifecycle 9.29.160.SNAPSHOT) requires 'osgi.service; (objectClass=org.wso2.carbon.andes.service.QpidService)' but it could not be found
- This issue requires adding these services to the
<Provide-Capability>tag in the relevant pom files. - Added the required services and moved forward. Still facing similar issues. Need to identify all of these and do the changes.
We closed all the PRs below because the task is on hold until we decide to start it again.
https://github.com/wso2-extensions/identity-governance/pull/830 https://github.com/wso2/carbon-registry/pull/438 https://github.com/wso2/carbon-identity-framework/pull/5775 https://github.com/wso2/orbit/pull/1127 https://github.com/wso2-extensions/identity-carbon-auth-saml2/pull/105 https://github.com/wso2/carbon-governance/pull/375 https://github.com/wso2/carbon-kernel/pull/4023 https://github.com/wso2/wso2-axis2/pull/285 https://github.com/wso2/carbon-commons/pull/494 https://github.com/wso2/maven-tools/pull/128 https://github.com/wso2-extensions/identity-inbound-auth-oauth/pull/2514 https://github.com/wso2-extensions/identity-organization-management/pull/386 https://github.com/wso2-extensions/identity-event-handler-notification/pull/246 https://github.com/wso2-extensions/identity-event-handler-account-lock/pull/141 https://github.com/wso2/wso2-axis2-transports/pull/347 https://github.com/wso2-extensions/apim-km-wso2is/pull/140 https://github.com/wso2-extensions/apim-km-wso2is/pull/139 https://github.com/wso2-extensions/identity-outbound-auth-oidc/pull/185 https://github.com/wso2/carbon-event-processing/pull/335 https://github.com/wso2/carbon-mediation/pull/1719 https://github.com/wso2/carbon-analytics-common/pull/844 https://github.com/wso2/carbon-apimgt/pull/12483 https://github.com/wso2/product-apim/pull/13510