cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco (JIRA)" <>
Subject [jira] [Created] (CXF-6821) XMLJavaTypeAdapter not working in Exception Classes
Date Fri, 04 Mar 2016 10:00:49 GMT
Marco created CXF-6821:

             Summary: XMLJavaTypeAdapter not working in Exception Classes
                 Key: CXF-6821
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.7.18, 2.7.17
         Environment: XMLJavaTypeAdapter not working in Exception Classes
            Reporter: Marco
             Fix For: Invalid

@XMLJavaTypeAdapter usage in Exception Classes does not work when mapping to a list of objects
not in the JAXB Context.

public class MyEJB {

    public void launcheMyException() throws MyException {

public class MyException extends Exception {

    List<MyClass1> obj1;

    public MyClass1 getObj1() {
		return obj1;
    public void setObj1(MyClass1 obj1) {
		this.obj1 = obj1;

public class Cl1ToCl2Adapter extends XmlAdapter<MyClass2,MyClass1> {

	public MyClass2 marshal(MyClass1 v) throws Exception {
		return new MyClass2();

	public MyClass1 unmarshal(MyClass2 v) throws Exception {
		MyClass1 mc1 = new MyClass1(v.getS2());
		return mc1;

This is what the resulting WSDL contains. 
List of MyClass1 is ignored. XMLJavaTypeAdapter takes no effect on the list.
If only one MyClass1 is present (not a list, single object) it works fine.

<xs:complexType name="MyException">
    <xs:element name="message" type="xs:string"/>

This message was sent by Atlassian JIRA

View raw message