Error: Could not initialize class javax.crypto.SunJCE_b

The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.
New Member

Error: Could not initialize class javax.crypto.SunJCE_b



I am using Teradata version and jre6 .


I created a user defined function in java which encrypts data using AES 256 bit Encryption. Created jar fie of this project and loaded this jar file on Teradata. Now i created a wrapper function in teradata to call UDF of java. When I call this wrapper function to encrypt data through UDF then I get the following error.

Executed as Single statement.  Failed [7828 : 38000] Unexpected Java Exception SQLSTATE 38000: An java.lang.NoClassDefFoundError (Could not initialize class javax.crypto.SunJCE_b) exception was thrown.
Elapsed time = 00:00:00.022
STATEMENT 1: Select Statement failed.


I already replaced the following jars with appropriate version (downloaded from Oracle site) but I am still getteing same error.

  • JRE/lib/security/local_policy.jar
  • JRE/lib/security/US_export_policy.jar

However, when i execute same jar file from command prompt, it returns encrypted value ( means works successfully).


Kindly suggest on this issue...