mit.navn.marcus Posted October 17, 2018 Share Posted October 17, 2018 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: atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService.createConnection(JdbcDataSourceService.java:64) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.BaseJdbcDataSource.setReportParameterValues(BaseJdbcDataSource.java:49) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService.setReportParameterValues(JdbcDataSourceService.java:69) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1823) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1169) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1051) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:946) atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) atjava.lang.Thread.run(Thread.java:748) 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. atorg.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:207) atorg.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64) atorg.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136) atorg.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29) atorg.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21) atorg.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31) atorg.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24) atorg.postgresql.Driver.makeConnection(Driver.java:393) atorg.postgresql.Driver.connect(Driver.java:267) atjava.sql.DriverManager.getConnection(DriverManager.java:664) atjava.sql.DriverManager.getConnection(DriverManager.java:247) atorg.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDriverManagerConnectionFactory.createConnection(JdbcDriverManagerConnectionFactory.java:36) atorg.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) atorg.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148) atorg.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.TibcoDriverManagerImpl.unlockConnection(TibcoDriverManagerImpl.java:68) atcom.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService.createConnection(JdbcDataSourceService.java:56) ... 9 more Caused by: java.net.ConnectException: Connection refused (Connection refused) atjava.net.PlainSocketImpl.socketConnect(Native Method) atjava.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) atjava.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) atjava.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) atjava.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) atjava.net.Socket.connect(Socket.java:589) atjava.net.Socket.connect(Socket.java:538) atorg.postgresql.core.PGStream.<init>(PGStream.java:60) atorg.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:101) ... 26 more[/code]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 https://github.com/TIBCOSoftware/JS-Dockerand the datasource is from: https://github.com/docker-library/postgresthe connection of the containers in the ssh: Link to comment Share on other sites More sharing options...
miwagada Posted October 17, 2018 Share Posted October 17, 2018 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. Link to comment Share on other sites More sharing options...
mit.navn.marcus Posted October 17, 2018 Author Share Posted October 17, 2018 @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. Link to comment Share on other sites More sharing options...
Solution hozawa Posted October 17, 2018 Solution Share Posted October 17, 2018 > Caused by: java.net.ConnectException: Connection refused (Connection refused) atThis 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".https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v71/jdbc-data-sources Link to comment Share on other sites More sharing options...
mit.navn.marcus Posted October 18, 2018 Author Share Posted October 18, 2018 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 https://community.jaspersoft.com/project/jasperreports-server/releases ) 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? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now