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 7FC76104AA for ; Thu, 22 Aug 2013 08:20:53 +0000 (UTC) Received: (qmail 63974 invoked by uid 500); 22 Aug 2013 08:20:53 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 63912 invoked by uid 500); 22 Aug 2013 08:20:52 -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 63893 invoked by uid 99); 22 Aug 2013 08:20:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 08:20:52 +0000 Date: Thu, 22 Aug 2013 08:20:52 +0000 (UTC) From: "mustafa (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CXF-5223) XMLJavaTypeAdapter not working in Exception Classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] mustafa resolved CXF-5223. -------------------------- Resolution: Duplicate > XMLJavaTypeAdapter not working in Exception Classes > --------------------------------------------------- > > Key: CXF-5223 > URL: https://issues.apache.org/jira/browse/CXF-5223 > Project: CXF > Issue Type: Bug > Components: JAXB Databinding > Affects Versions: 2.7.6 > Reporter: mustafa > Attachments: cxfTest.jar > > > @XMLJavaTypeAdapter usage in Exception Classes does not work when mapping to a class not in the JAXB Context. > {code:title=MyEJB.java} > @Stateless > @WebService > public class MyEJB { > public void launcheMyException() throws MyException { > return; > } > } > {code} > {code:title=MyException.java} > @XmlAccessorType(XmlAccessType.FIELD) > public class MyException extends Exception { > @XmlJavaTypeAdapter(Cl1ToCl2Adapter.class) > MyClass1 obj1; > @XmlJavaTypeAdapter(NoArgObjAdapter.class) > NoArgObj obj2; > public MyClass1 getObj1() { > return obj1; > } > > public void setObj1(MyClass1 obj1) { > this.obj1 = obj1; > } > public NoArgObj getObj2() { > return obj2; > } > public void setObj2(NoArgObj obj2) { > this.obj2 = obj2; > } > } > {code} > {code:title=Cl1ToCl2Adapter.java} > public class Cl1ToCl2Adapter extends XmlAdapter { > @Override > public MyClass2 marshal(MyClass1 v) throws Exception { > return new MyClass2(); > } > @Override > public MyClass1 unmarshal(MyClass2 v) throws Exception { > MyClass1 mc1 = new MyClass1(v.getS2()); > return mc1; > } > } > {code} > This is what the resulting WSDL contains. Obj2 is mapped fine to a String, but MyClass1 is not and should have the MyClass2 mapping here. > {code:xml} > > > > > > > {code} > If you add the same adapter to a non Exception class it works just fine. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira