You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Michael McGrady <mi...@michaelmcgrady.com> on 2004/03/27 16:26:35 UTC

java.security.NoSuchAlgorithmException in Tomcat

I am using j2se 1.4.2_04.  When I attempt to run 
java.security.KeyPairGenerator.getInstance("DH") in Tomcat, I get a stack 
trace as follows:


java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
         java.security.Security.getEngineClassName(Security.java:584)
         java.security.Security.getEngineClassName(Security.java:595)
         java.security.Security.getImpl(Security.java:1044)
         java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:146)
         org.apache.jsp.TEST_KEYPAIR_jsp._jspService(TEST_KEYPAIR_jsp.java:58)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I can run the DH generator from the command line.  So, the DH 
KeyPairGenerator IS available.  I have no trouble with Resin 2.1.x.  What 
is up?  Come on you guys, give me a hand here.  The documentation indicates 
that I should not be having a problem. 

Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Hmm, I just noticed that the following is commented out in jwsdp:

<!--
     <echo message="Setting xerces SAXParser as org.xml.sax.driver" />
     <echo message="And setting java.endorsed.dirs to use xerces and xalan" />

     <replace file="${S1AS_HOME}/domains/domain1/server1/config/server.xml"
      value='&lt;jvm-options>-Djava.endorsed.dirs=${S1AS_HOME}/share/lib/endorsed&lt;/jvm-options> 
&lt;jvm-options>-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser&lt;/jvm-options>'>
       <replacetoken><![CDATA[<jvm-options>-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter 
</jvm-options>]]></replacetoken>
     </replace>
-->

Could that be the source of the problem in some sense?

At 01:31 PM 3/27/2004, you wrote:
>Djava.endorsed



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


Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Thanks, Bill.  I take it, then, I would add it to:

jwsdp-shared\bin\jwsdponsunone.xml(206): 
value='&lt;jvm-options>-Djava.endorsed.dirs=${S1AS_HOME}/share/lib/endorsed&lt;/jvm-options> 
&lt;jvm-options>-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser&lt;/jvm-options>'>

under my circumstances?  And, would this be:
jwsdp-shared\bin\jwsdponsunone.xml(206): 
value='&lt;jvm-options>-Djava.endorsed.dirs=${S1AS_HOME}/share/lib/endorsed&lt;/jvm-options&$JAVA_HOME/jre/lib/ext> 
&lt;jvm-options>-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser&lt;/jvm-options>'>

???  Why would extension jars have to be manually configured in 
Tomcat?  Thanks.

At 12:23 PM 3/27/2004, Bill Barker wrote:

>----- Original Message -----
>From: "Michael McGrady" <mi...@michaelmcgrady.com>
>To: "Tomcat Developers List" <to...@jakarta.apache.org>
>Sent: Saturday, March 27, 2004 8:46 AM
>Subject: Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION
>
>
> > For some reason Tomcat is not seeing the com.sun.crypto.provider package
>in
> > jre/lib/ext.  The work around is to put the SunJCE provider
> > (sunjce_provider.jar) into commons/lib of Tomcat and to then add the
> > provider manually with
> >    Security.addProvider(new com.sun.crypto.provider.SunJCE()).  Why this
>is
> > necessary is a quandry to me.  If I had a clue why this was happening, I
> > would try to fix it.  But, this is not my area of expertise and I am
>stumped.
> >
>
>You can either add sunjce_provider.jar to $CATALINA_HOME/common/endorsed, or
>add $JAVA_HOME/jre/lib/ext to the -Djava.endorsed.dirs in the startup
>parameters.
>
> >
> > At 07:26 AM 3/27/2004, you wrote:
> > >I am using j2se 1.4.2_04.  When I attempt to run
> > >java.security.KeyPairGenerator.getInstance("DH") in Tomcat, I get a stack
> > >trace as follows:
> > >
> > >
> > >java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
> > >         java.security.Security.getEngineClassName(Security.java:584)
> > >         java.security.Security.getEngineClassName(Security.java:595)
> > >         java.security.Security.getImpl(Security.java:1044)
> > >
>java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:146)
> > >
>org.apache.jsp.TEST_KEYPAIR_jsp._jspService(TEST_KEYPAIR_jsp.java:58)
> > >
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> > >         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >
> >
> >org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
>204)
> > >
> > >org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> > >
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> > >         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >
> > >I can run the DH generator from the command line.  So, the DH
> > >KeyPairGenerator IS available.  I have no trouble with Resin 2.1.x.  What
> > >is up?  Come on you guys, give me a hand here.  The documentation
> > >indicates that I should not be having a problem.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
>
>Content-Type: text/plain; name="disclaimer.txt"
>Content-Disposition: inline; filename="disclaimer.txt"
>Content-Transfer-Encoding: 7bit
>MIME-Version: 1.0
>X-Mailer: MIME-tools 5.411 (Entity 5.404)
>
>
>This message is intended only for the use of the person(s) listed above as 
>the intended recipient(s), and may contain information that is PRIVILEGED 
>and CONFIDENTIAL.  If you are not an intended recipient, you may not read, 
>copy, or distribute this message or any attachment. If you received this 
>communication in error, please notify us immediately by e-mail and then 
>delete all copies of this message and any attachments.
>
>In addition you should be aware that ordinary (unencrypted) e-mail sent 
>through the Internet is not secure. Do not send confidential or sensitive 
>information, such as social security numbers, account numbers, personal 
>identification numbers and passwords, to us via ordinary (unencrypted) e-mail.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org



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


Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message ----- 
From: "Michael McGrady" <mi...@michaelmcgrady.com>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Saturday, March 27, 2004 8:46 AM
Subject: Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION


> For some reason Tomcat is not seeing the com.sun.crypto.provider package
in
> jre/lib/ext.  The work around is to put the SunJCE provider
> (sunjce_provider.jar) into commons/lib of Tomcat and to then add the
> provider manually with
>    Security.addProvider(new com.sun.crypto.provider.SunJCE()).  Why this
is
> necessary is a quandry to me.  If I had a clue why this was happening, I
> would try to fix it.  But, this is not my area of expertise and I am
stumped.
>

You can either add sunjce_provider.jar to $CATALINA_HOME/common/endorsed, or
add $JAVA_HOME/jre/lib/ext to the -Djava.endorsed.dirs in the startup
parameters.

>
> At 07:26 AM 3/27/2004, you wrote:
> >I am using j2se 1.4.2_04.  When I attempt to run
> >java.security.KeyPairGenerator.getInstance("DH") in Tomcat, I get a stack
> >trace as follows:
> >
> >
> >java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
> >         java.security.Security.getEngineClassName(Security.java:584)
> >         java.security.Security.getEngineClassName(Security.java:595)
> >         java.security.Security.getImpl(Security.java:1044)
> >
java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:146)
> >
org.apache.jsp.TEST_KEYPAIR_jsp._jspService(TEST_KEYPAIR_jsp.java:58)
> >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> >         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> >
>
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
204)
> >
> >org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> >
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> >         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> >
> >I can run the DH generator from the command line.  So, the DH
> >KeyPairGenerator IS available.  I have no trouble with Resin 2.1.x.  What
> >is up?  Come on you guys, give me a hand here.  The documentation
> >indicates that I should not be having a problem.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Re: java.security.NoSuchAlgorithmException in Tomcat SOLUTION

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
For some reason Tomcat is not seeing the com.sun.crypto.provider package in 
jre/lib/ext.  The work around is to put the SunJCE provider 
(sunjce_provider.jar) into commons/lib of Tomcat and to then add the 
provider manually with
   Security.addProvider(new com.sun.crypto.provider.SunJCE()).  Why this is 
necessary is a quandry to me.  If I had a clue why this was happening, I 
would try to fix it.  But, this is not my area of expertise and I am stumped.


At 07:26 AM 3/27/2004, you wrote:
>I am using j2se 1.4.2_04.  When I attempt to run 
>java.security.KeyPairGenerator.getInstance("DH") in Tomcat, I get a stack 
>trace as follows:
>
>
>java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
>         java.security.Security.getEngineClassName(Security.java:584)
>         java.security.Security.getEngineClassName(Security.java:595)
>         java.security.Security.getImpl(Security.java:1044)
>         java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:146)
>         org.apache.jsp.TEST_KEYPAIR_jsp._jspService(TEST_KEYPAIR_jsp.java:58)
>         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
> 
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>I can run the DH generator from the command line.  So, the DH 
>KeyPairGenerator IS available.  I have no trouble with Resin 2.1.x.  What 
>is up?  Come on you guys, give me a hand here.  The documentation 
>indicates that I should not be having a problem.



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


Re: java.security.NoSuchAlgorithmException in Tomcat

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
When I run Security.getProviders() I do not get SunJCE, even though I have 
the following in the java.security file:

security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.sun.rsajca.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
Why is that?  When I run from the command line, I do get SunJCE.  That is 
the difference.
At 07:26 AM 3/27/2004, you wrote:
>I am using j2se 1.4.2_04.  When I attempt to run 
>java.security.KeyPairGenerator.getInstance("DH") in Tomcat, I get a stack 
>trace as follows:
>
>
>java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
>         java.security.Security.getEngineClassName(Security.java:584)
>         java.security.Security.getEngineClassName(Security.java:595)
>         java.security.Security.getImpl(Security.java:1044)
>         java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:146)
>         org.apache.jsp.TEST_KEYPAIR_jsp._jspService(TEST_KEYPAIR_jsp.java:58)
>         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
> 
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>I can run the DH generator from the command line.  So, the DH 
>KeyPairGenerator IS available.  I have no trouble with Resin 2.1.x.  What 
>is up?  Come on you guys, give me a hand here.  The documentation 
>indicates that I should not be having a problem.