I installed the EC2 API tools this morning on a system that has the IBM JRE pre-installed. At first, running any EC2 command resulted in the following error:
<snip>
Exception in thread "main" java.lang.NoClassDefFoundError: javax.crypto.b (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:132)
at javax.crypto.Cipher.getInstance(Unknown Source)
at com.ibm.jsse2.gb.a(gb.java:51)
</snip>
Google didn't find any exact matches for the problem although there were a few posts about the IBM vs Sun JRE... not much related to EC2. The results did however give enough of a hint for what to play around with.
Fortunately, the "fix" was fairly simple.
The java.security file (in this dir on my system: /usr/lib/jvm/java-1_5_0-ibm-1.5.0_sr7/jre/lib/security) had the following security providers (in order):
#
# List of providers and their preference orders (see above):
#
security.provider.1=com.ibm.jsse2.IBMJSSEProvider2
security.provider.2=com.ibm.crypto.provider.IBMJCE
security.provider.3=com.ibm.security.jgss.IBMJGSSProvider
security.provider.4=com.ibm.security.cert.IBMCertPath
security.provider.5=com.ibm.security.sasl.IBMSASL
I switch the order of the first two to the following:
#
# List of providers and their preference orders (see above):
#
security.provider.1=com.ibm.crypto.provider.IBMJCE
security.provider.2=com.ibm.jsse2.IBMJSSEProvider2
security.provider.3=com.ibm.security.jgss.IBMJGSSProvider
security.provider.4=com.ibm.security.cert.IBMCertPath
security.provider.5=com.ibm.security.sasl.IBMSASL
After this, the ec2 tools worked!
In any case, hopefully this helps others who run into the same problem. And hopefully it doesn't break anything else!
Comments