Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5348

ArchiveDeployer.deployInternal() always uses null rootCause

    XMLWordPrintable

Details

    • Hide

      1) Modify a test so that it fails to deploy to JBoss.
      2) See that there is no root cause exception attached.

      Show
      1) Modify a test so that it fails to deploy to JBoss. 2) See that there is no root cause exception attached.

    Description

      deployInternal() in ArchiveDeployer (from arquillian/) walks back along the chain of initialCause exceptions to attach the root cause to the thrown exception, presumably in an attempt to reduce the clutter in the output.

      The way it does so is incorrect and will always result in rootCause=null. I think that it should just attach "ex" as-is, but if stripping the intermediate exceptions is what is desired, then the while condition should be "rootCause != null && rootCause.getCause() != null", so that it extracts the last one.


      Throwable rootCause = ex.getCause();
      while (null != rootCause)

      { rootCause = rootCause.getCause(); }

      throw new DeploymentException("Cannot deploy: " + name, rootCause);

      Attachments

        Activity

          People

            ozizka_jira Ondrej Zizka (Inactive)
            rhn-support-jlivings James Livingston (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: