Loading

Policy Apply Fails With Java 17 Based Runtime

Publiceringsdatum: May 28, 2025
Beskrivning

SYMPTOM

The error below is received during deployment or while applying a Policy on API Manager. The API's corresponding Mule application is based on Java 17(eg, Runtime 4.6 + Java 17).

**********************************************************************
* Policy: analytics-policy-17233117 @                                *
* my-testapp-api-main                                                *
* OS encoding: UTF-8, Mule encoding: UTF-8                           *
*                                                                    *
**********************************************************************
[2024-07-29 04:04:13.665] ERROR   com.mulesoft.mule.runtime.gw.policies.deployment.DefaultPolicyDeployer [agw-policy-set-deployment.01]: Error deploying policy client-id-enforcement-mule-3058796 to application my-testapp
org.mule.runtime.deployment.model.api.policy.PolicyRegistrationException: Error occured registering policy 'client-id-enforcement-mule-3058796 @ my-testapp-api-main'
	at org.mule.runtime.deployment.model.impl@4.6.5/org.mule.runtime.module.deployment.impl.internal.application.MuleApplicationPolicyProvider.addPolicy(MuleApplicationPolicyProvider.java:112)
	at com.mulesoft.anypoint.gw.core@4.6.5/com.mulesoft.mule.runtime.gw.model.ApiImplementation.addPolicy(ApiImplementation.java:86)
	at com.mulesoft.anypoint.gw.module.policies@4.6.5/com.mulesoft.mule.runtime.gw.policies.deployment.DefaultPolicyDeployer.internalDeploy(DefaultPolicyDeployer.java:79)
...
Caused by: org.mule.runtime.api.lifecycle.InitialisationException: Cannot create artifact context for the policy instance
	at org.mule.runtime.deployment.model.impl@4.6.5/org.mule.runtime.module.deployment.impl.internal.policy.DefaultApplicationPolicyInstance.initPolicyContext(DefaultApplicationPolicyInstance.java:135)
...
Caused by: org.mule.runtime.module.extension.internal.manager.jdk.JavaVersionNotSupportedByExtensionException: Extension 'SoapFault' does not support Java 17. Supported versions are: [1.8, 11]
	at org.mule.runtime.extensions.support@4.6.5/org.mule.runtime.module.extension.internal.manager.jdk.StrictExtensionJdkValidator.onUnsupportedJdkVersion(StrictExtensionJdkValidator.java:26)
	at org.mule.runtime.extensions.support@4.6.5/org.mule.runtime.module.extension.internal.manager.jdk.BaseExtensionJdkValidator.validateJdkSupport(BaseExtensionJdkValidator.java:36)
...

 


CAUSE

This error occurs because an old version of the policy is being used, which is not compatible with Java 17.

SOLUTION

Update the policy version to the latest one on the API Manager to resolve this issue. Refer to the API Manager Policies Release Notes page for all the policies: https://docs.mulesoft.com/release-notes/policies/policies-release-notes

For Example, This error was observed with Client ID Enforcement Policy v1.3.0 and policy application was successful with Client ID Enforcement Policy v1.3.2.

1) Update the policy version as shown in the screenshot below and apply the changes.

2) In case the error continues to occur then delete the Policy once and Re-apply the policy, since policy upgrade/application may fail under some conditions.

3) If none of them helps, please file a Support case ticket with the following information

  • The error log file
  • Application deployment model (Eg, CloudHub 1.0/2.0, On-premise, RTF, etc)
  • Application name
  • Policy Name
  • Policy version
Knowledge-artikelnummer

002471445

 
Laddar
Salesforce Help | Article