IBM Support

IBM Java for AIX: java.lang.CloneNotSupportedException after installing or upgrading to Java 8 SR7 and above

Troubleshooting


Problem

After installing or upgrading to Java8 SR7 and later SR levels, Java application will fail with java.lang.CloneNotSupportedException, when they use clone method with Message Digest implementation.

Exception in thread "main" java.lang.CloneNotSupportedException
        at java.security.MessageDigest$Delegate.clone(MessageDigest.java:595)
        at Main.main(Main.java:8)


Cause

The observed change in behavior is due to the switch from the IBMJCE provider to the IBMJCEPlus provider, which came into effect by default in IBM Java 8.0.7.0:

https://www.ibm.com/docs/en/sdk-java-technology/8?topic=wn-service-refresh-7

Currently, IBMJCEPlus does not support Cloning. IBMJCE supports cloning. Hence, the MessageDigest implementation in IBMJCE provides the clone() method, but the implementation in IBMJCEPlus does not, and this implementation is working as designed in both providers.


Resolving The Problem

The suggested work-around is to place IBMJCE ahead of IBMJCEPlus in <JAVA_INSTALL_DIR>/jre/lib/security/java.security file.

That is, change the order of the providers in the java.security file as shown here:

From:

security.provider.1=com.ibm.jsse2.IBMJSSEProvider2
security.provider.2=com.ibm.crypto.plus.provider.IBMJCEPlus
security.provider.3=com.ibm.crypto.provider.IBMJCE
security.provider.4=com.ibm.security.jgss.IBMJGSSProvider
To:
security.provider.1=com.ibm.jsse2.IBMJSSEProvider2
security.provider.2=com.ibm.crypto.provider.IBMJCE
security.provider.3=com.ibm.crypto.plus.provider.IBMJCEPlus
security.provider.4=com.ibm.security.jgss.IBMJGSSProvider

SUPPORT:

If you require more assistance, use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract.  

1. Document (or collect screen captures of) all symptoms, errors, and messages related to your issue.

2.  Capture any logs or data relevant to the situation.

3.  Contact IBM to open a case:

   -For electronic support, visit the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, see the web page:
      https://www.ibm.com/planetwide/

4.  Provide a clear, concise description of the issue.

 - For more information, see: Working with IBM AIX Support: Describing the problem.

5.  If the system is accessible, collect a system snap, and upload all of the details and data for your case.

 - For more information, see: Working with IBM AIX Support: Collecting snap data

 -You can attach files to your case in the IBM Support Community
 -Or Upload data to IBM testcase server analysis:

    http://www.ibm.com/support/docview.wss?uid=ibm10733581

6.  Click here to submit feedback for this document.


[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cvwrAAA","label":"Communication Applications"},{"code":"a8m50000000L0G1AAK","label":"Java"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

More support for:
AIX

Component:
Communication Applications, Java

Software version:
All Versions

Document number:
7106993

Modified date:
10 January 2024

UID

ibm17106993

Manage My Notification Subscriptions