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/

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