Jasper Server sends two requests

For our Project we are developing a web app consisting of a TypeScript Frontend and Java Backend. In this app, the user has the option to request a report. The report is generated by Jasper Server v7. To get access to the required data, we have added a JSON-DataSource to the Jasper Server, which uses the REST-API of our Java Backend. When we call the Jasper Server, we use a few request parameters, which in turn are also used for the JSON-DataSource.
To create the DataSource, we have to use default-parameters for the request parameters. If we just keep the fields empty, it just throws an error and doesn't let us continue. 

Our problem is, whenever we request a report now, our backend is called two times, first with the default parameters we used when we set up the report, an then with the parameters we send to request the report. Is there any way to prevent the first "default" call? Everything is functioning correctly, but the unnecessary  request just creates more load on our server, which we want to reduce. 

Our JasperSoft Studio Version is 6.12.2 (we use this version on purpose, since the newer versions lead to other problems). 

jaspersoft_313's picture
Joined: Apr 17 2023 - 2:09am
Last seen: 5 months 2 weeks ago

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

arai_4 - 5 months 2 weeks ago

Hi jaspersoft_313, could you please provide more info on the error that you encounter when you create your JSON datasource with the default params ? You should be able to create your DS without any default params. 

Please share the error logs and the screen shots of how you're setting your DS. 

Thanks

bdraifi - 5 months 2 weeks ago

Hi bdraifi,

you're right, the json datasource doesn't require default params, I misremembered. But even if I don't use default params, our backend still gets two requests from the jasper server, first an "empty" request and then the request with the correct url-parameters, so the problem stays the same

jaspersoft_313 - 5 months 2 weeks ago
show 1 more...

Hello, we had to found a workaround for that.

We added a parameter called "ping" with true as default value

The defaut values are used in that stange first call.

In the backend, if "ping"is true, we return a success and no value

Then, we call the data forcing "ping"to false to get the real value

This is very strange, it seems this first call is a "hey, do you live ?" called with /inputcontrol url

I hope it will hepl

dany.isenguerre - 5 months 2 weeks ago

1 Answer:

Hello, we got the same problem 3 or 4 years ago and we had to found a workaround for that.

We added a parameter called "ping" with "true" as default value

It seems the defaut values of the parameters are used in that stange first call.

In the backend, if "ping"is "true", we return a success and no value.

Then, we call the data forcing "ping" to false to get the real values

This is very strange, it seems this first call is a "hey, do you live ?" called via the /inputcontrol url. That's why we called that dummy parameter "ping"

I hope it will help

 

Dany

dany.isenguerre's picture
Joined: Jul 28 2016 - 6:42am
Last seen: 5 months 2 weeks ago
Feedback