You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Niemaz <ni...@xrce.xerox.com> on 2003/04/23 18:48:24 UTC

SOLVED (Re: tomcat3.2b and JCE (j2sdk1.4) : encryption/decryption won't work)

Got it yaaaaaaaaaahooooooooooo ;-)
Finally.

The problem was that somehow java is looking for those so famous 
security files in $JAVA_HOME/lib/security.
If, like stupid me, you have set $JAVA_HOME to (for ex) 
/opt/java/j2sdk1.4.1/ instead of /opt/java/j2sdk1.4.1/jre/,
it won't work. THere's no security directory in 
/opt/java/j2sdk1.4.1/lib/ but there is one in /opt/java/j2sdk1.4.1/jre/lib/

Now, how come this is happening? I thought there was a bit of 
intelligence somewhere in java ? Can't he realize
that he is not running through jre?
Or is there a way to tell him that the security files are in such place 
whereas still running the /opt/java/j2sdk1.4.1/bin/java?

If you can help ...

thanx,

--mike

Michael Niemaz wrote:

> Thanx Andy, I've tried thid already and it's true I found a lot of stuff
>
> there.
> However, it never worked for me so far ;-(
> But I won't give up ;-)
>
> --mike
>
> Andy Eastham wrote:
>
>> Michael,
>>
>> Try searching for
>> Cannot locate policy or framework files for signer restraint check
>> on Google.  It turned up quite a bit of stuff.
>>
>> As ever, Google is a great first line of attack for solving problems
>
> like
>
>> this.
>>
>> Andy
>>
>>  
>>
>>> -----Original Message-----
>>> From: Michael Niemaz [mailto:niemaz@xrce.xerox.com]
>>> Sent: 22 April 2003 16:26
>>> To: Tomcat-User
>>> Subject: tomcat3.2b and JCE (j2sdk1.4) : encryption/decryption won't
>>> work
>>>
>>>
>>> Hello,
>>>  I'm desprately trying to make my simple encrypt/decrypt example
>>> work within tomcat. I get the following error:
>>>
>>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>> at javax.crypto.Cipher.a(DashoA6275)
>>> at javax.crypto.Cipher.getInstance(DashoA6275)
>>> at utils.Crypto.encrypt(Crypto.java:38)
>>> at
>>> engine.managers.InitializationManager.init(InitializationManager.java:
>>
> 599)
>
>>> at
>>> engine.managers.InitializationManager.init(InitializationManager.java:
>>
> 557)
>
>>> at
>>> engine.managers.InitializationManager.initAll(InitializationManage
>>> r.java:851)
>>> at
>>> servers.rmi.ServerRMIInterfaceImpl.initDocSoul(ServerRMIInterfaceI
>>> mpl.java:440)
>>> at
>>> userInterface.servlets.Servletinitializer.init(Servletinitializer.
>>> java:160)
>>> at
>>
> org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
>
>>> at org.apache.tomcat.core.Handler.init(Handler.java:215)
>>> at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
>>> at
>>> org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(Loa
>>>   
>>
>> dOnStartupInterceptor.java:130)
>>  
>>
>>> at
>>> org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:
>>
> 491)
>
>>> at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
>>> at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
>>> at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
>>> Caused by: java.lang.SecurityException: Cannot set up certs for
>>> trusted CAs
>>> at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
>>> ... 16 more
>>> Caused by: java.lang.SecurityException: Cannot locate policy or
>>> framework files for signer restraint check!
>>> at javax.crypto.SunJCE_b.i(DashoA6275)
>>> at javax.crypto.SunJCE_b.h(DashoA6275)
>>> at javax.crypto.SunJCE_v.run(DashoA6275)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>>
>>> It crashes on the 'Cipher.getInstance' invocation.
>>>
>>> I've tried to copy the 'jce' jars into the tomcat lib repo : no luck.
>>> I've tried to launch tomcat with a java policy : no more luck ;-(
>>>
>>> I've searched through old emails from the ML and it seems very easy to
>>> fix ... but I still can't make it work ;-(
>>>
>>> Has somebody encountered the same pb with the same config?
>>>
>>> Any help would be greatly appreciated ;-)
>>>
>>> thanx,
>>>
>>> --mike
>>>
>>>
>>> Hello,
>>>
>>> I've read a lot about it in some newsgroups but there were no
>>
> solution.
>
>>> How can I configure Tomcat 4.0.3 to work with JCE 1.2.1. I've already
>>> copied the 4 JCE jar files into the ${JAVA_HOME}/jre/lib/ext dir, into
>>> the ${TOMCAT_HOME}/lib dir, into the WEB-INF/lib dir of my web
>>> application - I get the exception "Cannot set up certs for trusted
>>
> CAs".
>
>>> I also configured the files java.policy and java.security in
>>> ${JAVA_HOME}/jre/lib/security, but it doesn't work.
>>>
>>> Is it a bug? Do I something wrong? Please help me, I cannot solve this
>>> problem.
>>>
>>> Best regards,
>>>
>>> Danny
>>>
>>>
>>>   
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>> .
>>
>>  
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org