Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4429

JaxB marshalling failure due to endorsed java.lang.Exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0, 3.0.5, 2.4.4, 4.0.4
    • Fix Version/s: 4.1.0, 2.4.4, 4.0.5, 3.0.7
    • Component/s: karaf
    • Labels:
      None

      Description

      The endorsed java.lang.Exception, which expose the public method

      public Class[] getClassContext() {
          return classContext;
      }
      

      is the reason of the failure of JaxB marshalling in certain use-cases (for example, when it is used for SOAP Fault by CXF). This is due to the method being seen as property (the method signature has the form of a "getter") and the default behavior of JaxB is to marshal properties.

      As a result, any exception marshalled inside Karaf create an invalid XML which includes a list of <classContext> tags corresponding to this property, and clients outside of Karaf fail to unmarshall it.

      The issue has been discussed on the Karaf Dev mailing list, see full discussion here:
      http://karaf.922171.n3.nabble.com/Problems-due-to-the-endorsed-java-lang-Exception-td4045861.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gnt Guillaume Nodet
                Reporter:
                cristcost Cristiano Costantini
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: