Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 8310 invoked from network); 10 Nov 2009 19:59:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 19:59:58 -0000 Received: (qmail 73091 invoked by uid 500); 10 Nov 2009 19:59:57 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 72950 invoked by uid 500); 10 Nov 2009 19:59:57 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 72922 invoked by uid 99); 10 Nov 2009 19:59:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 19:59:56 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of struts234@gmail.com designates 209.85.217.221 as permitted sender) Received: from [209.85.217.221] (HELO mail-gx0-f221.google.com) (209.85.217.221) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 19:59:46 +0000 Received: by gxk21 with SMTP id 21so346759gxk.10 for ; Tue, 10 Nov 2009 11:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XHyr7xVVBq8ij3osCk+OH4fGW7S25xpQGHm+eOgl170=; b=EPp1j8J+u8seBw9G5yn+im7Jj2TfyyE0Ub01e7VSRwYWiATbmpz5LDS20sBw+m3UGK P1DZUbCWAhcKM/6VcXTqLcNMBlK+RkzJrIWjlvuS+PQLfrbCKGqFYxLGyYMWQ4j6MMCu Uy60WMfEVO+V4cCylIchVVw0VlqESU5in2Omo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ehkav2z+3Wgi24HGQX5YfyARG8A3vSinQCu3+hEHsrpTOEaOHr9BsQO47406Th97Nw wWRj7i8lRkJV6BU9vlsvWnAGwnNEs43LZ/hyO8I6fh+eVlVtbAblNHz0Z7uqxj47SHsb 0D3P91mhj1hj3rqGLmz/OFc9PyIxPooMKGUqU= MIME-Version: 1.0 Received: by 10.100.235.38 with SMTP id i38mr896993anh.51.1257883164408; Tue, 10 Nov 2009 11:59:24 -0800 (PST) In-Reply-To: <598ad5b50911101112i1ad3f369k5852810e908d0332@mail.gmail.com> References: <598ad5b50911101112i1ad3f369k5852810e908d0332@mail.gmail.com> Date: Tue, 10 Nov 2009 14:59:24 -0500 Message-ID: Subject: Re: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String; From: Java Struts To: Commons Users List Content-Type: multipart/alternative; boundary=001636b2b4542efcb9047809bf18 X-Virus-Checked: Checked by ClamAV on apache.org --001636b2b4542efcb9047809bf18 Content-Type: text/plain; charset=ISO-8859-1 Hi Julis, Thanks a lot for the response. Here is the info. I am thinking it might be the classpath issue. But i am not 100% sure. Thanks, On Tue, Nov 10, 2009 at 2:12 PM, Julius Davies wrote: > Hi, > > Can you supply some version information? > > Local machine > ----------------------------- > OS Type and Version? *Windows Xp Pro* > Java Version? *1.5* > Websphere version? *6.0* > Commons-Codec version? *1.4* > > > Dev machine > ----------------------------- > OS Type and Version? Linux. *HP-UX, B.11.11 * > Java Version? :1.5 > Websphere version? 6.0 > Commons-Codec version? 1.4 > > > Also, can you find out if any different versions of commons-codec are > also present on the dev machine? Perhaps several versions of the jar > file are sitting around, and Websphere is picking up an old one? > > > > yours, > > Julius > > > > > > On Tue, Nov 10, 2009 at 10:13 AM, Java Struts wrote: > > Hi Folks, > > > > I am using Apache Commons Codec, to convert the encrypted bytes into a > > HexString to pass through the URL. So when i am using it in local machine > > which is working fine. when the same into Dev(Linux websphere) it's not > > working and it's throwing the following exception. > > > > *java.lang.NoSuchMethodError: > > > org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String;* > > > > Here is the code i am using for it. > > > > *public static String encryptString(SecretKey key, String input) throws > > NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException { > > logger.error(" Input String to Encrypt: " + input ); > > Cipher cipher = Cipher.getInstance("DESede"); > > cipher.init(Cipher.ENCRYPT_MODE, key); > > //byte[] inputBytes = input.getBytes(); > > String encryptedString =""; > > byte[] inputBytes; > > > > try { > > logger.error(" Inside Try block of Encrypted String Method"); > > inputBytes = input.getBytes("UTF-8"); > > byte[] encryptedBytes= cipher.doFinal(inputBytes); > > logger.error(" got encrypted bytes"); > > > > encryptedString= Hex.encodeHexString(encryptedBytes); > > logger.error(" Encrypted String : " +encryptedString); > > } > > catch (UnsupportedEncodingException e) { > > // TODO Auto-generated catch block > > logger.error("Inside Unsupported Catch Block " + > e.getMessage() > > + " : "+ e ); > > e.printStackTrace(); > > > > > > } > > catch (Throwable e) { > > // TODO Auto-generated catch block > > logger.error("Inside Exception Catch Block " + e.getMessage() > + > > " : " +e ); > > e.printStackTrace(); > > } > > return encryptedString;* > > > > > > Could you please help me guys, I am just wondering why this is throwing > in > > Dev. It's throwing the exceptions at the below line. > > > > *encryptedString= Hex.encodeHexString(encryptedBytes); > > * > > and catching at here > > > > *catch (Throwable e) { > > // TODO Auto-generated catch block > > logger.error("Inside Exception Catch Block " + e.getMessage() > + > > " : " +e ); > > e.printStackTrace(); > > } > > > > *any idea what's going on here?* *I would appreciate for your help.* > > > > *Thanks,* > > > > > > * > > > > > > -- > yours, > > Julius Davies > 250-592-2284 (Home) > 250-893-4579 (Mobile) > http://juliusdavies.ca/logging.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --001636b2b4542efcb9047809bf18--