[#14061] - Ajax call problem due to upgrade to JasperReport V6.19.0

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

Update from JasperReport V6.18.1 to V6.19.0. Firing a ajax request from page to controller. I find that ajax function cannot receive data returning from controller. This issue did not occur when I downgrade back to V6.18.1 or even V6.17.0.

My dependency is:
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.19.0</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.19.0</version>
</dependency>

Js part:
$.ajax({
url : url,
success : function(data) {
if (data.status == 'success') {
$("#text").html(data.text);
} else {
$("#text").css("color", "red");
$("#text").html(data.message.toUpperCase());
alert(data.message);
}
},
error : function(error) {
alert(error.responseText);
}
});

controller part:

@GetMapping("...url")
public ResponseEntity<HashMap<String, Object>> getCurrentSystemYear() {
HashMap<String, Object> map = new HashMap<>();
map.put("status", "success");
map.put("message","testing...");

return new ResponseEntity<>(map, HttpStatus.OK);
}

jasper library
vl.work's picture
Joined: Mar 2 2022 - 8:32pm
Last seen: 16 hours 44 min ago

3 Comments:

#1
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

Not sure which controller are you talking about. JasperReports Library is not a web application.
Are you sure there is no error on the server side application where JRL is used?
Did you check the logs?

Thanks,
Teodor

#2

I am using spring boot. There is no error in back end in log.
An error captured at font end at browser debugger which indicated the data returned from backend is undefined.
There is no any update on coding. I just update the version of jasper report.

AttachmentSize
Image icon capture.png14.45 KB
#3

After I exclude jackson-dataformat-xml. The issue gone and without affect report generation. However, I don't know whether it would have adverse behavior to my ssystem.

<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.19.1</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.19.1</version>
</dependency>

AttachmentSize
Image icon capture2.png16.82 KB
Feedback