Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5982647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:07:01+00:00 2026-05-22T22:07:01+00:00

How do I print a Groovy stack trace? The Java method, Thread.currentThread().getStackTrace() produces a

  • 0

How do I print a Groovy stack trace? The Java method, Thread.currentThread().getStackTrace() produces a huge stack trace, including a lot of the Groovy internals. I’m seeing a function called twice from a StreamingMarkupBuilder that looks like it should only be called once and I would like to see why Groovy thinks it should be calling it twice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:07:01+00:00Added an answer on May 22, 2026 at 10:07 pm

    Solution:

    org.codehaus.groovy.runtime.StackTraceUtils.sanitize(new Exception()).printStackTrace()
    

    Original answer:

    A Google search returns the following information:

    Apparently, there is a method in org.codehaus.groovy.runtime.StackTraceUtils called printSanitizedStackTrace. There isn’t much documentation for the method, though there is a method called sanitize which is described as

    remove all apparently groovy-internal
    trace entries from the exception
    instance This modifies the original
    instance and returns it, it does not
    clone

    So I would try org.codehaus.groovy.runtime.StackTraceUtils.printSanitizedStackTrace(Throwable t) (it is static)
    and see if that works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one invoke a groovy method that prints to stdout, appending the output
I've encountered a strange issue with Groovy's (1.7.3) XmlUtil.serialize( GPathResult ) method. It throws
I’m trying to split a String . Simple examples work: groovy:000> print abc,def.split(,); [abc,
How would I go about making every method call of every groovy class of
I am building a system in Java/Groovy that involves dynamic invocation of Web services.
I need to print the contents of my groovy console onto a swing Builder's
Anyone who knows how the print the source of a closure in Groovy? For
I am using Groovy's AntBuilder to build a Java project. An error is occurring
Print all 12 verses of the popular holiday song . By 12 verses I
print <ul>; foreach ($arr as $value) { echo(<li> . $value[storeid] . . ($value[dvdstock] +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.