Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10973

@XmlJavaTypeAdapter ignored at package-info.java level when using Generics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.3.0.GA
    • EAP_EWP 5.2.0
    • Web Services
    • None
    • JBoss EAP 5.2.0 + CXF + JBPAPP-10628 + JBPAPP-10927 (one off patches for EAP 5.2.0)

    • Workaround Exists
    • Hide

      A good workaround for this is to not use package-info.java and have the annotation @XmlJavaTypeAdapter sit on the property instead

          @XmlJavaTypeAdapter(type = TestRef.class, value = TestXmlAdapter.class)
          private List<TestRef> refs;
      

      You should make sure that the @XmlAccessType annotation is also removed prior to this.

      Show
      A good workaround for this is to not use package-info.java and have the annotation @XmlJavaTypeAdapter sit on the property instead @XmlJavaTypeAdapter(type = TestRef.class, value = TestXmlAdapter.class) private List<TestRef> refs; You should make sure that the @XmlAccessType annotation is also removed prior to this.
    • Hide
      In previous versions of JBoss EAP 5, it was found that, in environments that incorporated the resolutions to bugs JBPAPP-10458 and JBPAPP-10926, the @XmlJavaTypeAdapter attribute was ignored at the package-info.java level. This was because a related upstream CXF fix (CXF-5219) had not been included in the product. This fix has now been incorporated and the issue resolved.
      Show
      In previous versions of JBoss EAP 5, it was found that, in environments that incorporated the resolutions to bugs JBPAPP-10458 and JBPAPP-10926 , the @XmlJavaTypeAdapter attribute was ignored at the package-info.java level. This was because a related upstream CXF fix (CXF-5219) had not been included in the product. This fix has now been incorporated and the issue resolved.
    • Documented as Resolved Issue
    • NEW

      With an environment with both fixes for JBPAPP-10458 and JBPAPP-10926 applied, the below does not work and throws an exception as if JBPAPP-10458 was not there.

      Unable to find source-code formatter for language: title:usedinws.java. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      @XmlType(name = "TestDto")
      @XmlAccessorType(XmlAccessType.FIELD)
      public class TestDto {
      
          private List<TestRef> refs;
          private TestRef refObj;
      
          public List<TestRef> getRefs() {
              return refs;
          }
      	
         public TestRef getRefObj() {
      	return refObj;
         }
      }
      

      If you remove the use of Generics from this example everything works as expected.

      This is a regression caused by JBPAPP-10926.

        1. cxf-rt-frontend-jaxws.jar-JBPAPP-10628
          324 kB
          Mustafa Musaji
        2. outcomes.txt
          7 kB
          Mustafa Musaji

              rhn-engineering-ema Jim Ma
              rhn-support-mus Mustafa Musaji
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: