I'm encountering a strange problem using JCE 1.2 with JBoss-2.4.4_Tomcat-4.0.1. I deploy an EAR that contains, among other things:
- a JAR with EJB's (not used yet)
- a WAR with a servlet
- Sun's "jce1.2-do.jar"
- A JCE crypto provider ("crypto.jar")
The WAR's MANIFEST.MF points to the jar's and everything works fine when first deployed. However, if I RE-deploy (without changing any code; simply re-copy the EAR into JBoss's deploy/ directory), now the code breaks, and I get the following exception:
[ERROR,Default] java.security.NoSuchAlgorithmException: Class com.myco.crypto.provider.rsa.PKCS1Cipher configured for Cipher not a Cipher
[ERROR,Default] at javax.crypto.JceSecurity.getImpl(JceSecurity.java:180)
[ERROR,Default] at javax.crypto.Cipher.getInstance(Cipher.java:347)
Of course, PKCS1Cipher is indeed a Cipher, as this code works fine upon initial deployment. I've tried it with different providers and the results are the same. The only way to make the problem go away again is to restart JBoss. Has anyone else encountered this behavior?
Thanks for any help, this one has me stumped!! -gw