JiBX
  1. JiBX
  2. JIBX-233

Partial stack trace is printed when JiBXException is wrapped in another exception

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.6
    • Fix Version/s: JiBX 1.2.1
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      JiBXException has its own mechanism for dealing with nested exceptions. However, when running in JDK 5 and if outer most exception class is not JiBXException (e.g. org.apache.maven.plugin.MojoExecutionException) only partial stack trace is printed. This impedes investigations of bad binding files as in many cases root cause exception is not printed.

      This is due to printStackTraceAsCause method implementation in Throwable class.

      One way to fix is to implement getCause() method as following:

      public Throwable getCause()

      { return getRootCause(); }

      this way printStackTraceAsCause will honour the root cause that JiBXException contains.

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Thanks for the recommendation, I'll give the change a try.

        The reason JiBX has its own chaining technique is because it is preserving compatibility with older JDKs. As long as we can continue to do that, changes to make it work better with later JDKs are great.

        Show
        Dennis Sosnoski added a comment - Thanks for the recommendation, I'll give the change a try. The reason JiBX has its own chaining technique is because it is preserving compatibility with older JDKs. As long as we can continue to do that, changes to make it work better with later JDKs are great.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Vladimir Berezniker
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: