Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D735109A5 for ; Wed, 2 Oct 2013 17:44:52 +0000 (UTC) Received: (qmail 90959 invoked by uid 500); 2 Oct 2013 17:44:51 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 90808 invoked by uid 500); 2 Oct 2013 17:44:46 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 90192 invoked by uid 99); 2 Oct 2013 17:44:43 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 17:44:43 +0000 Date: Wed, 2 Oct 2013 17:44:43 +0000 (UTC) From: "Jesse Pangburn (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-5317) Policy exception handler throws away useful exception stack trace MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Jesse Pangburn created CXF-5317: ----------------------------------- Summary: Policy exception handler throws away useful exception stack trace Key: CXF-5317 URL: https://issues.apache.org/jira/browse/CXF-5317 Project: CXF Issue Type: Improvement Components: WS-* Components Affects Versions: 2.7.7, 2.7.6 Reporter: Jesse Pangburn I had a working WS-Policy which was encrypting the SOAP body with a UsernameToken using Basic128 encryption, then I modified the policy to use Basic256 encryption instead. I got the following stack trace cause: Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.policyNotAsserted(AbstractBindingBuilder.java:294) Since the exception was short on detail, I went to the source code and found that AbstractBindingBuilder.java:294 was simply throwing away the rest of the Exception object. There's a method existing already to take the exception too so I changed that line to call it and now get the following MUCH more useful error message on the end of the stack trace: Caused by: org.apache.xml.security.encryption.XMLEncryptionException: Invalid AES key length: 20 bytes Original Exception was java.security.InvalidKeyException: Invalid AES key length: 20 bytes I'll attach a patch to this issue to resolve this. -- This message was sent by Atlassian JIRA (v6.1#6144)