Skip to content

[fix] Replace printStackTrace() with System.err in CompileReport#1606

Open
Senrian wants to merge 1 commit intoapache:mainfrom
Senrian:fix/remove-printstacktrace-jasperreports
Open

[fix] Replace printStackTrace() with System.err in CompileReport#1606
Senrian wants to merge 1 commit intoapache:mainfrom
Senrian:fix/remove-printstacktrace-jasperreports

Conversation

@Senrian
Copy link

@Senrian Senrian commented Mar 3, 2026

Description

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
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
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

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