Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8181475

java.beans.XMLEncoder unable to serialize StackTraceElement

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      XMLEncoder requires JavaBeans object to serialize it, so you have to define a public default constructor (with no arguments) whereas StackTraceElement does not have a public default constructor.

      So the below error is thrown.

      java.lang.InstantiationException: java.lang.StackTraceElement
      Continuing ...
      java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();
      Continuing ...
      java.lang.InstantiationException: java.lang.StackTraceElement
      Continuing ...
      java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();
      Continuing ...
      java.lang.Exception: Encoder: discarding statement RuntimeException.setStackTrace(StackTraceElementArray);
      Continuing ...




      REPRODUCIBILITY :
      This bug can be reproduced always.

            bchristi Brent Christian
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: