Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4537

XmlAdapter Not Being Used

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.6, 2.6.3, 2.7
    • Component/s: JAXB Databinding
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      XmlAdapter is not being used for marshalling/unmarshalling in a JAX-WS service with the following conditions:

      -XmlAdapter is being hooked up with @XmlJavaTypeAdapters in package-info.java
      -Class that XmlAdapter handles (bound type) has a no-arg constructor

      If the no-arg constructor is removed from the bound type, the XmlAdapter is correctly used.

      For more info, please see:
      http://stackoverflow.com/questions/12684103/xmladapter-not-being-used-in-cxf

      In attached sample maven project, the main method is in com.internal.SomeService. Running it should throw an exception with the following cause:

      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
      java.util.Currency does not have a no-arg default constructor.
      this problem is related to the following location:
      at java.util.Currency
      at public java.util.Currency com.external.Money.getCurrency()
      at com.external.Money

        Attachments

        1. cxf.zip
          5 kB
          Andy Chang

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              achang Andy Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: