jaxb
  1. jaxb
  2. JAXB-931

Unmarshalling: An invalid payload followed by a valid payload runs into exception. The next try of valid payload goes through.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.6
    • Fix Version/s: None
    • Component/s: runtime
    • Labels:
      None

      Description

      I single unmarshaller instance is used to unmarshal an invalid XML payload; which runs into an Exeception (InstantiationException).
      Upon catching the exception and re-trying a valid payload, the unmarshaller still runs into a different type of Exception (ClassCast).
      Upon catching the exception during the 2nd try above and trying a valid payload again, unmarshaller successfully unmarshals the payload.

      I have attached a sample (self-contained) eclipse based Java Project with the Main class, which is showing the above behavior.

        Activity

        Hide
        Martin Grebac added a comment -

        Adjusting priority, possible solution is to re-create unmarshaller instances in your code.

        Show
        Martin Grebac added a comment - Adjusting priority, possible solution is to re-create unmarshaller instances in your code.
        Hide
        anand_h added a comment -

        I would like to know if there is any way to identify a "corrupted" unmarshaller; so as to conditionally re-create the instance for the workaround. This is critical from the performance point-of-view.

        Show
        anand_h added a comment - I would like to know if there is any way to identify a "corrupted" unmarshaller; so as to conditionally re-create the instance for the workaround. This is critical from the performance point-of-view.

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            anand_h
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: