tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Tomcat Servlet & Bouncy Castle Problem
Date Thu, 02 Oct 2008 20:52:36 GMT

you'll want to make sure bcprov-ext-jdk15-140.jar is in WEB-INF=lib

from
http://www.bouncycastle.org/latest_releases.html

feel free to ping me offline for implementation specific issues

cheers,
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 


> From: john@kewlstuff.co.za
> To: users@tomcat.apache.org
> Subject: Re: Tomcat Servlet & Bouncy Castle Problem
> Date: Thu, 2 Oct 2008 16:53:46 +0200
> 
> 
> ----- Original Message ----- 
> From: "Jeng Yu" <jengyu2007@yahoo.co.uk>
> To: <users@tomcat.apache.org>
> Sent: Thursday, October 02, 2008 10:19 AM
> Subject: Tomcat Servlet & Bouncy Castle Problem
> 
> 
> > Hello Friends!
> >
> > I have a debugging problem here that I hope the gurus
> > here can help me figure out.
> >
> > I'm trying to do RSA public key encryption in a
> > servlet that I'm developing inside Netbeans 6.1. I'm
> > using the Bouncy Castle (BC) crypto package. When I
> > build the servlet, there are no errors. Then I run it,
> > and Netbeans invokes the Tomcat 6.0.16 container in it
> > and  waits for a client to conect. But when I connect
> > to the servlet from a client, it crashes when it
> > executes this line in my code:
> >
> > private RSAPrivateCrtKeyParameters RSAprivKey = null;
> >
> > with this message in the Tomcat log output:
> >
> > SEVERE: Allocate exception for servlet Fortune
> > java.lang.NoClassDefFoundError:
> > Lorg/bouncycastle/crypto/params/RSAPrivateCrtKeyParameters;
> > Interestngly, the same RSA public encryption code with
> > Bouncy Castle library works flawlessly when I develop
> > it in Netbeans IDE and run it as a java application
> > (not servlet). In servlet environment, it fails. Yes,
> > I added cldc_classes.zip class library file from
> > Bouncy Castle to compile the code.
> >
> > Oh, and the client reports the following error when
> > trying to connect to the servlet:
> >
> > The server encountered and internal error that
> >        prevented it from fulfilling this request.
> > ServletException: Error instantiating servlet
> >        class fortune.Fortune.
> >
> > What am I not doing right? Has anyone else seen
> > something similar and what's the
> > getaround/workaround?
> >
> > Thanks,
> >
> > Jeng Yu
> 
> Jeng we use BC in servlets and have no problems, but its a long time since I 
> was into it...
> I think you need to get into their mailing lists or what ever they have....
> 
> I cant remember using the cldc_classes.zip .... isnt that for JavaME only? 
> ... because it doesnt have BIGINT or something... make sure you not screwing 
> Java now.
> If your BC is in the class path, take it out of there and try get it going 
> in your test apps...
> If in doubt... use the source code for BC... so A you can remove the huge 
> amount of stuff you wont need... and B if I remember correctly we spent a 
> lot of time making it independent of JCE which seems to change every java 
> version...
> 
> Only place those libs must be is in your web app...
> 
> Anyway its not TC... bouncy castle is one complex piece of code with a 
> million options and forks
> 
> ... make sure its not in the classpath...
> 
> Good luck
> 
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message