Hi,

Try to place JCE/JSSE in tomcat.home/lib, or even better in the
jre/lib/ext - and see if this solved the problem. My guess - it's related
to some code doing a Class.forName() instead of using the context class
loader or the context loader is not set.( for 3.2.x you _must_ add the
Jdk12Interceptor if you want the context class loader set. If you haven't
- that should be the first step. )

You could also try with 3.3beta1 - class loader has been completely
redesigned and works pretty well now. I have no problems with JSSE ( I
tested it today )

Costin



On Wed, 29 Aug 2001, SUBRAHMANYAM,VEENA (HP-MountainView,ex1) wrote:

> Hi
>
> I have been experiencing some problems using JCE, in the tomcat environment.
>
> I am using tomcat 3.2.2, and JCE 1.2.1., xerces_1_4_1.jar, cocoon 2.0 ...
>
> I am using JCE to encrypt and decrypt some XML docs. The program to encrypt
> and decrypt works in standalone mode. But when it is run within the servlet
> env, an "java.lang.SecurityException: Cannot set up certs for trusted CAs"
> exception is thrown at the the following lines of code:
>  Cipher cipherDes = Cipher.getInstance("DES/ECB/PKCS5Padding");
>  secretKeyDesKey = KeyGenerator.getInstance("DES").generateKey();
>
> (the detailed stack trace is pasted at the bottom of this email)
>
> I have found that this exception has been reported to be thrown, by various
> people, in the tomcat archives, due to classloader hierarchy problems,
> JarURLConnection / WARConnection clashes etc.
> I have found emails that allude to a fix, if some set of these jars are
> placed in the tomcat-home/lib dir instead of the
> tomcat-home/webapps/cocoon/web-inf/lib dir, but have not been able to locate
> further info....(my JCE 1.2.1 related jars, xerces.jar, etc are all in the
> tomcat-home/webapps/cocoon/web-inf/lib directory).
>
> I think this, or a flavor of this problem is a known bug in tomcat...
>
> Can someone, give me a workaround or a fix or a guestimate for the
> resolution?
>
> Thanx in advance..
>
> Veena
>
> P.s:
>  The exception I get is as follows:
> ------------------------------------------------------------
> 2001-08-29 07:09:13 - Ctx( /cocoon ): Exception in: R( /cocoon + /request1 +
> null) - java.lang.ExceptionInInitializerError: java.lang.SecurityException:
> Cannot set up certs for trusted CAs
>         at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
>         at javax.crypto.Cipher.getInstance([DashoPro-V1.2-120198])
>         at
> org.apache.cocoon.transformation.XmlEncryptor.encryptElement(XMLEncryptionTr
> ansformer.java:453)
>         at
> org.apache.cocoon.transformation.XmlEncryptor.encryptChildNodes(XMLEncryptio
> nTransformer.java:335)
>         at
> org.apache.cocoon.transformation.XmlEncryptor.encrypt(XMLEncryptionTransform
> er.java:295)
>         at
> org.apache.cocoon.transformation.XMLEncryptionTransformer.endElement(XMLEncr
> yptionTransformer.java:154)
>         at
> org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
>         at
> org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator
> .java:1385)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
> LDocumentScanner.java:1205)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
> java:381)
>         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
>         at
> org.apache.cocoon.components.parser.JaxpParser.parse(JaxpParser.java:72)
>         at
> org.apache.cocoon.generation.StreamGenerator.generate(StreamGenerator.java:1
> 09)......
>
> ----------------------------------------
>
>

Reply via email to