retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

Support for SQL Server #37

Closed kamrannawaz closed 3 years ago

kamrannawaz commented 3 years ago

I want to know what changes are needed to support a mssql server container. Thanks

grange74 commented 3 years ago

Do you mean as a data source (https://community.jaspersoft.com/wiki/using-ms-sql-server-data-source-jasperreports-server) or for the jasperserver database or both?

Either way one of the first things to do is add the jdbc driver to the drivers folder https://github.com/retrievercommunications/docker-jasperserver/tree/master/drivers and update the docker file to copy it into the container like: https://github.com/retrievercommunications/docker-jasperserver/blob/master/Dockerfile#L41

kamrannawaz commented 3 years ago

Do you mean as a data source (https://community.jaspersoft.com/wiki/using-ms-sql-server-data-source-jasperreports-server) or for the jasperserver database or both?

Either way one of the first things to do is add the jdbc driver to the drivers folder https://github.com/retrievercommunications/docker-jasperserver/tree/master/drivers and update the docker file to copy it into the container like: https://github.com/retrievercommunications/docker-jasperserver/blob/master/Dockerfile#L41

yes i tried so many other things & every time i got this type of error whenever i run that image.. i don't know what is this could you plz help me out? what is the problem error which i get every time. standard_init_linux.go:228: exec user process caused: no such file or directory

git

grange74 commented 3 years ago

can you please be more specific about what steps/commnads you've done to get that error message? like are you just trying to run the container or are you rebuilding it? in order to get the drivers in you will need to rebuild the container.

Also please answer the above question about what you are trying to achieve?

Do you mean as a data source (https://community.jaspersoft.com/wiki/using-ms-sql-server-data-source-jasperreports-server) or for the jasperserver database or both?

kamrannawaz commented 3 years ago

can you please be more specific about what steps/commnads you've done to get that error message? like are you just trying to run the container or are you rebuilding it? in order to get the drivers in you will need to rebuild the container.

Also please answer the above question about what you are trying to achieve?

Do you mean as a data source (https://community.jaspersoft.com/wiki/using-ms-sql-server-data-source-jasperreports-server) or for the jasperserver database or both?

i want to run jasper with SQL Server database not with postgress or MySql but with SQL Server i downloaded those jdbc driver for sql server and place them inside the driver folder. This is the dockerfile which i m using to build image

FROM tomcat:9.0-jre8

ENV JASPERSERVER_VERSION 7.8.0

COPY ./jasperreports-server-cp-${JASPERSERVER_VERSION}-bin ./usr/src/jasperreports-server

ADD wait-for-it.sh /wait-for-it.sh

ADD entrypoint.sh /entrypoint.sh ADD .do_deploy_jasperserver /.do_deploy_jasperserver

RUN chmod a+x /entrypoint.sh && \ chmod a+x /wait-for-it.sh

ADD ./drivers/mssql-jdbc-9.4.0.jre8.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/app-srv-jdbc-drivers/db2jcc4.jar ADD ./drivers/mysql-connector-java-5.1.44-bin.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/app-srv-jdbc-drivers/mysql-connector-java-5.1.44-bin.jar ADD web.xml /usr/local/tomcat/conf/ application-servers ENV JAVA_OPTS="-Xms1024m -Xmx2048m -XX:PermSize=32m -XX:MaxPermSize=512m -Xss2m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"

ENTRYPOINT ["/entrypoint.sh"]

grange74 commented 3 years ago

From looking at the installer guide again, only MySQL and PostgreSQL are supported for the Jasperserver database. You can only use SQL Server for a datasource of one of your reports.

Rebuilding with the above dockerfile should work for using as a datasource. Although you should rename "db2jcc4.jar" in the line below:

ADD ./drivers/mssql-jdbc-9.4.0.jre8.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/app-srv-jdbc-drivers/db2jcc4.jar

kamrannawaz commented 3 years ago

From looking at the installer guide again, only MySQL and PostgreSQL are supported for the Jasperserver database. You can only use SQL Server for a datasource of one of your reports.

Rebuilding with the above dockerfile should work for using as a datasource. Although you should rename "db2jcc4.jar" in the line below:

ADD ./drivers/mssql-jdbc-9.4.0.jre8.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/app-srv-jdbc-drivers/db2jcc4.jar

i tried with renaming too then i changed it to what driver u putting, btw i want to run jasper with SQL not as a datasource but as a storage db like postgress and mysql, so how want to do that is jasper supports this thing or not or it just use postgress or mysql

grange74 commented 3 years ago

It is not feasible to make it work with SQL Server. The jasperserver release comes with all sql files to create/update the database but only for MySQL and PostgreSQL under buildomatic/install_resources/sql. Even if you created all the sql server equivalent, the other problem is that it hasn't been tested with SQL server so if you come across any errors you will have to fix the code yourself.