Reports works in Studio, but not on Server

When running a report in jaspersoft studio it succesfully generates a report, with data adapted from a container of a postgres database on a ssh. the server is running as a jaspersoft for docker server on the same ssh.

however, after publishing the report to the jasperserver, when running the report on the server I get the following error trace:

com.jaspersoft.jasperserver.api.JSException: jsexception.error.creating.connection Arguments: at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService.createConnection( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.BaseJdbcDataSource.setReportParameterValues( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService.setReportParameterValues( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ at
java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at Caused by: org.postgresql.util.PSQLException:
    Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl( at
org.postgresql.core.ConnectionFactory.openConnection( at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>( at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>( at
org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>( at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>( at
org.postgresql.jdbc4.Jdbc4Connection.<init>( at
org.postgresql.Driver.makeConnection( at
org.postgresql.Driver.connect( at
java.sql.DriverManager.getConnection( at
java.sql.DriverManager.getConnection( at
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDriverManagerConnectionFactory.createConnection( at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject( at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject( at
org.apache.commons.dbcp.PoolingDataSource.getConnection( at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.TibcoDriverManagerImpl.unlockConnection( at
 ... 9 more Caused by: Connection refused (Connection refused) at Method) at at at at at at at
org.postgresql.core.PGStream.<init>( at
 ... 26 more

any ideas what the problem is? and is there a way to see what the remaining 26 errors are?

I've used the jaspersoft for docker from
and the datasource is from:

the connection of the containers in the ssh:

mit.navn.marcus's picture
Joined: Oct 4 2018 - 1:10am
Last seen: 3 years 7 months ago

4 Answers:

> Caused by: Connection refused (Connection refused) at

This seems to suggest there's a problem with connecting to your postgresql from JasperReports Server. Have you tried testing the data source from JasperReports Server to make sure the connection is good. In the Data Source page, select "Test Connection".

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago

Edit the published report and select proper database (which you have created in your server). OR 

Select proper database in Jasper studio while publishing to Jasper server.

If still not able to connect to db, restart your Jasperserver service and your connected db.


miwagada's picture
Joined: Nov 23 2015 - 1:32am
Last seen: 4 years 2 months ago

@miwagada Thanks for your answer, I have the report on the server connected to the correct database (since it works on jaspersoft studio) my problem is that when I run the report on the server I get the mentioned error trace.

 edited original post for more clear language. 

mit.navn.marcus's picture
Joined: Oct 4 2018 - 1:10am
Last seen: 3 years 7 months ago

Hello and thanks for your accurate answer @hozawa (I wasn't aware of being able to add data sources so this helped me a lot)

it indeed seems like on my dockerized jaspersoft server I can't get a connection to my dockerized datasource. However if I run the standard jasperreport server service (from ) and use the same parameters I can get a connection to my dockerised data source. So the problem must be in how I've made my dockerised jasperreport server.

Do you have any idea what it might possibly be?

mit.navn.marcus's picture
Joined: Oct 4 2018 - 1:10am
Last seen: 3 years 7 months ago