Skip to content

WW-5617 Replace printStackTrace() with System.err in CompileReport#1606

Merged
lukaszlenart merged 1 commit intoapache:mainfrom
Senrian:fix/remove-printstacktrace-jasperreports
Mar 13, 2026
Merged

WW-5617 Replace printStackTrace() with System.err in CompileReport#1606
lukaszlenart merged 1 commit intoapache:mainfrom
Senrian:fix/remove-printstacktrace-jasperreports

Conversation

@Senrian
Copy link
Contributor

@Senrian Senrian commented Mar 3, 2026

Description

Closes WW-5617

Replace e.printStackTrace() with System.err.println() to properly log errors to stderr without stack trace noise in CLI tools.

Changes

  • plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/CompileReport.java: Replace e.printStackTrace() with System.err.println() for cleaner error output

Why

Using printStackTrace() in production code is considered bad practice as it writes directly to stderr without proper logging framework integration. This change uses System.err.println() which is more appropriate for CLI tools.

Replace e.printStackTrace() with System.err.println() to properly
log errors to stderr without stack trace noise in CLI tools.

Issue: JRException handling in JasperReports compilation
@lukaszlenart
Copy link
Member

Could you create a JIRA ticket?
https://issues.apache.org/jira/projects/WW/

@Senrian
Copy link
Contributor Author

Senrian commented Mar 4, 2026

Created JIRA ticket: https://issues.apache.org/jira/browse/WW-5506

This is a simple code cleanup replacing printStackTrace() with System.err for better logging practice.

@lukaszlenart
Copy link
Member

@Senrian but the ticket is about file upload issue and not related to Jasper Reports changes

@Senrian
Copy link
Contributor Author

Senrian commented Mar 4, 2026

Sorry for the confusion - this PR is indeed a code cleanup (replacing printStackTrace with System.err), not related to file upload. I created a new JIRA ticket for this code cleanup: https://issues.apache.org/jira/browse/WW-5507

@lukaszlenart
Copy link
Member

Hm... but this Bump org.apache.velocity:velocity-engine-core from 2.3 to 2.4.1 which isn't related to the change and it was included in 7.0.3

@lukaszlenart lukaszlenart changed the title [fix] Replace printStackTrace() with System.err in CompileReport WW-5617 Replace printStackTrace() with System.err in CompileReport Mar 13, 2026
@lukaszlenart lukaszlenart merged commit 47d46f7 into apache:main Mar 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants