I have a jasper report that uses a JSON data adapter to retrieve data from a rest api. The username and password for http basic authentication should be set dynamically. Therefore the reports has input parameter for them. In Jaspersoft Studio it works well, but on the JasperReports Server a unauthorized error is thrown even before prompting the user to enter the values for the parameters.
The error message on the server: 2019-10-17 08:54:01,136 ERROR GenericExceptionMapper,http-nio-8080-exec-6:51 - Unexpected error occurs net.sf.jasperreports.engine.JRRuntimeException: Response has status code HTTP/1.1 401 Unauthorized.
I wonder why it works on Studio but not on the Server.
This is how i forward the input parameters to the dataadapter:
<parameter name="USERNAME" class="java.lang.String">
<parameter name="PASSWORD" class="java.lang.String">
When you deployed the report to the JasperReports Server, what data source did you use for the Report Unit?
A JasperReports Server data source is not a data adapter.
You could try setting the report to use a data adapter on the server, as per https://community.jaspersoft.com/wiki/how-deploy-and-use-data-adapter-jasperreports-server-v56