Bug 999893 - XMLJavaTypeAdapter not working in Exception Classes
XMLJavaTypeAdapter not working in Exception Classes
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Services (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity high
: ER7
: EAP 6.2.0
Assigned To: Alessio Soldano
Rostislav Svoboda
Russell Dickenson
:
Depends On: 1021549
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 06:43 EDT by Mustafa Musaji
Modified: 2013-12-15 11:23 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:23:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
TestCase (7.55 KB, application/zip)
2013-11-05 04:16 EST, Petr Sakař
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBWS-3690 Major Closed XMLJavaTypeAdapter not working in Exception Classes 2014-08-08 09:39:17 EDT
Apache JIRA CXF-5219 None None None Never

  None (edit)
Description Mustafa Musaji 2013-08-22 06:43:03 EDT
Platform BZ for https://issues.jboss.org/browse/JBWS-3690

Given the interface:
@javax.jws.WebService
public interface WsIntfc {
    public void test() throws MyException;
}

And exception class:
public class MyException extends Exception {
  private MyClass1 adapted = null;
  
  @XmlJavaTypeAdapter(Cl1ToCl2Adapter.class)
  public MyClass1 getAdapted() {
      return this.adapted;
  }
  
  public void setAdapted(MyClass1 adapted) {
      this.adapted = adapted;
  }
}

Along with:
public class Cl1ToCl2Adapter extends XmlAdapter<MyClass2, MyClass1> {
  @Override
  public MyClass1 unmarshal(MyClass2 v) throws Exception {
      MyClass1 mc1 = new MyClass1();
      mc1.setName(v.getFile());
      return mc1;
  }

  @Override
  public MyClass2 marshal(MyClass1 v) throws Exception {
      MyClass2 mc2 = new MyClass2();
      mc2.setFile(v.getName());
      return mc2;
  }
}

public class MyClass1 {
  private String name = null;
  
  public String getName() {
    return this.name;
  }
  
  public void setName(String name) {
    this.name = name;
  }
  
}

public class MyClass2 {
  private String file = null;
  
  public String getFile() {
    return this.file;
  }
  
  public void setFile(String file) {
    this.file = file;
  }
}



I get the following schema output:

<xs:complexType name="myClass1">
  <xs:sequence>
    <xs:element minOccurs="0" name="name" type="xs:string"/>
  </xs:sequence>
</xs:complexType>
<xs:complexType name="MyException">
  <xs:sequence/>
</xs:complexType>


I should expect myClass2 defined in the schema and referenced by MyException.
Comment 1 Rostislav Svoboda 2013-09-23 04:59:43 EDT
Should be fixed in CXF 2.7.7 / JBossWS CXF 4.2.1
Comment 2 Alessio Soldano 2013-09-23 05:10:14 EDT
Rostislav, JBossWS 4.2.1.Final was released without Apache CXF upgrade to 2.7.7.
Comment 4 Rostislav Svoboda 2013-09-23 09:25:56 EDT
Alessio, thanks for clarification. I didn't check the pom for cxf version.
Comment 6 JBoss JIRA Server 2013-10-21 05:12:20 EDT
Alessio Soldano <asoldano@redhat.com> updated the status of jira JBWS-3690 to Resolved
Comment 7 JBoss JIRA Server 2013-10-21 10:11:03 EDT
Alessio Soldano <asoldano@redhat.com> updated the status of jira JBWS-3690 to Closed
Comment 9 Petr Sakař 2013-11-05 04:16:08 EST
Created attachment 819597 [details]
TestCase

mvn verify -Djboss.home=/home/development/jbossqe/JBEAP-6.2.0.ER6/build/jboss-eap-6.2
Comment 10 Petr Sakař 2013-11-05 04:17:33 EST
Verify using attachment from comment#9 
EAP 6.2.0.ER7 passed
EAP 6.2.0.ER6 failed

Note You need to log in before you can comment on or make changes to this bug.