Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 47250 invoked from network); 10 Nov 2009 18:14:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 18:14:25 -0000 Received: (qmail 21161 invoked by uid 500); 10 Nov 2009 18:14:23 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 21058 invoked by uid 500); 10 Nov 2009 18:14:22 -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 21043 invoked by uid 99); 10 Nov 2009 18:14:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 18:14:17 +0000 X-ASF-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of struts234@gmail.com designates 209.85.210.189 as permitted sender) Received: from [209.85.210.189] (HELO mail-yx0-f189.google.com) (209.85.210.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 18:14:15 +0000 Received: by yxe27 with SMTP id 27so265435yxe.10 for ; Tue, 10 Nov 2009 10:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=g5q25cFP5DILYdvOrSTRkeMw2JmmSd8T4c/W96NbxFs=; b=WakHArpBY5EvnoxH/L3IGai51MWpYvzGINKt22B8YFjzQRv4nWQi9Bu5nScVVS9Zpb +FZ9uYyF5ym3aJogJoxbSjft1ul8Adj+8K3hsPbHvZdQoQCWZfRL6OBSGiR75/wLo0Hm wYKbpnlQnG7M2aKMDzKWg312ubeLU+fQf2tNw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=VbvYogQLyAQseMxnP4CPM79l9Ex7mrB/fyDT1Coxzw44rPoFSJcF06XwJx+GpXoHcD ZAxUQ7AWWes3NY/BBNq6KDM0pGmzmvVurfcu55yO37ew2W8C27xd4l6z3zYQKQG0vDIe IcTobWPgITlddftPQDIbk6MYGW3VdtJQhmhBY= MIME-Version: 1.0 Received: by 10.101.7.28 with SMTP id k28mr686624ani.49.1257876822550; Tue, 10 Nov 2009 10:13:42 -0800 (PST) Date: Tue, 10 Nov 2009 13:13:42 -0500 Message-ID: Subject: 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=001636c92cc82de78f0478084516 --001636c92cc82de78f0478084516 Content-Type: text/plain; charset=ISO-8859-1 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,* * --001636c92cc82de78f0478084516--