You are on page 1of 8

Installation of JasperServer 4.2.

1 with MySQL
1.)Install the JasperServer with postgressql in the workstation.
Also Install MySQL on the system and note down the port number and credentials. Execute the
JasperServer script in MySQL query browser.
2.)In all the .properties file in the location
Jasperserver 4.2.1\apache tomcat\webapps\jasperserver-pro\web-INF
, configure the MySQL credentials. The propertie files we changed are as follows :-
Js.jdbc.properties
js.quartz.properties
hibernate.properties

In the js.jdbc.properties file
Replace the code :-
# Property that determines the Hibernate dialect
metadata.hibernate.dialect=com.jaspersoft.hibernate.dialect.PostgresqlNoBlobDialect
# jasperserver repo db settings
metadata.jdbc.driverClassName=org.postgresql.Driver
metadata.jdbc.url=jdbc:postgresql://localhost:5432/jasperserver
metadata.jdbc.username=postgres
metadata.jdbc.password=postgres
metadata.jndi=jdbc/jasperserver
metadata.database.generate=true
# foodmart db settings
foodmart.jdbc.driverClassName=org.postgresql.Driver
foodmart.jdbc.url=jdbc:postgresql://localhost:5432/foodmart
foodmart.jdbc.username=postgres
foodmart.jdbc.password=postgres
foodmart.jndi=jdbc/foodmart
# sugarcrm db settings
sugarcrm.jdbc.driverClassName=org.postgresql.Driver
sugarcrm.jdbc.url=jdbc:postgresql://localhost:5432/sugarcrm
sugarcrm.jdbc.username=postgres
sugarcrm.jdbc.password=postgres
sugarcrm.jndi=jdbc/sugarcrm
# sugarcrm is also referenced as test in unit tests
test.jdbc.driverClassName=org.postgresql.Driver
test.jdbc.url=jdbc:postgresql://localhost:5432/sugarcrm
test.jdbc.username=postgres
test.jdbc.password=postgres
test.jndi=jdbc/sugarcrm
# flag used to skip some unit tests or to use uppercase schema files
test.databaseFlavor=postgresql
test.createMinimalData=${test.set.createMinimalData}
foodmart.upperCaseNames=false
sugarcrm.upperCaseNames=false
# used to add parms to tomcat datasource: context.xml
# todo: still used?
datasource.extra.params=

With the following code
# Property that determines the Hibernate dialect
metadata.hibernate.dialect=com.jaspersoft.hibernate.dialect.MySQLDialect
# jasperserver repo db settings
metadata.jdbc.driverClassName=org.hibernate.dialect.MySQLDialect
metadata.jdbc.url=jdbc:mysql://localhost:3308/jasperserver
metadata.jdbc.username=root
metadata.jdbc.password=pasword
metadata.jndi=jdbc/jasperserver
metadata.database.generate=true
# foodmart db settings
foodmart.jdbc.driverClassName=com.mysql.jdbc.Driver
foodmart.jdbc.url=jdbc:mysql://localhost:3308/foodmart
foodmart.jdbc.username=root
foodmart.jdbc.password=password
foodmart.jndi=jdbc/foodmart
# sugarcrm db settings
sugarcrm.jdbc.driverClassName=com.mysql.jdbc.Driver
sugarcrm.jdbc.url=jdbc:mysql://localhost:3308/sugarcrm
sugarcrm.jdbc.username=root
sugarcrm.jdbc.password=password
sugarcrm.jndi=jdbc/sugarcrm
# sugarcrm is also referenced as test in unit tests
test.jdbc.driverClassName=com.mysql.jdbc.Driver
test.jdbc.url=jdbc:mysql://localhost:3308/sugarcrm
test.jdbc.username=root
test.jdbc.password=password
test.jndi=jdbc/sugarcrm
# flag used to skip some unit tests or to use uppercase schema files
test.databaseFlavor=mysql
test.createMinimalData=${test.set.createMinimalData}
foodmart.upperCaseNames=false
sugarcrm.upperCaseNames=false
# used to add parms to tomcat datasource: context.xml
# todo: still used?
datasource.extra.params=




In the js.quartz.properties file
Replace the code :-
# This file will consolidate all the configurable quartz properties
#
# Other properties which didn't need configuration are kept in js.quartz.base.properties
quartz.delegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
quartz.tablePrefix=QRTZ_
quartz.extraSettings=
report.scheduler.web.deployment.uri=http://localhost:8080/jasperserver-pro
report.scheduler.mail.sender.host=mail.localhost.com
report.scheduler.mail.sender.username=admin
report.scheduler.mail.sender.password=password
report.scheduler.mail.sender.from=admin@localhost.com
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=25
With the following code
# This file will consolidate all the configurable quartz properties
#
# Other properties which didn't need configuration are kept in js.quartz.base.properties
quartz.delegateClass=org.quartz.impl.jdbcjobstore.MySQLDialect
quartz.tablePrefix=QRTZ_
quartz.extraSettings=
report.scheduler.web.deployment.uri=http://localhost:8080/jasperserver-pro
report.scheduler.mail.sender.host=mail.localhost.com
report.scheduler.mail.sender.username=admin
report.scheduler.mail.sender.password=password
report.scheduler.mail.sender.from=admin@localhost.com
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=25

In the hibernate.properties file
Replace the code:-
# Properties file with JDBC-related settings.
# Applied by PropertyPlaceholderConfigurer from "applicationContext-*.xml".
# Targeted at system administrators, to avoid touching the context XML files.
# Property that determines the Hibernate dialect
metadata.hibernate.dialect=com.jaspersoft.hibernate.dialect.PostgresqlNoBlobDialect
metadata.hibernate.dataSource.jndiName=jdbc/jasperserver
#
# default_schema setting will be uncommented if your database requires
# a schema to be specified (such as for DB2)
#
#metadata.hibernate.default_schema=${metadata.hibernate.default_schema}
With the following code
# Properties file with JDBC-related settings.
# Applied by PropertyPlaceholderConfigurer from "applicationContext-*.xml".
# Targeted at system administrators, to avoid touching the context XML files.
# Property that determines the Hibernate dialect
metadata.hibernate.dialect=org.hibernate.dialect.MySQLDialect
metadata.hibernate.dataSource.jndiName=jdbc/jasperserver
#
# default_schema setting will be uncommented if your database requires
# a schema to be specified (such as for DB2)
#
#metadata.hibernate.default_schema=${metadata.hibernate.default_schema}

3.) In the location,
jasperreports-server-4.2.1\apache-tomcat\conf\Catalina\localhost
Replace the code inside the file jasperserver-pro.xml with the following code :-


<Context path="/jasperserver-pro"
debug="5" reloadable="false" crossContext="true">
<!-- maxActive: Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<!-- maxIdle: Maximum number of idle dB connections to retain in pool.
Set to -1 for no limit. See also the DBCP documentation on this
and the minEvictableIdleTimeMillis configuration parameter.
-->
<!-- maxWait: Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<!-- Additional properties for specifying a validation query to help -->
<!-- with reconnect/timeout errors. Exact syntax will vary with -->
<!-- database type (this tested on mysql). -->
<!-- -->
<!-- validationQuery="select 1" -->
<!-- testOnBorrow="true" -->
<!-- (and add to url property): &amp;autoReconnectForPools=true -->
<Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="password"
driverClassName="com.mysql.jdbc.Driver"
validationQuery="SELECT 1"
testOnBorrow="true"
url="jdbc:mysql://localhost:3308/jasperserver"/>
<Resource name="jdbc/sugarcrm" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password"
driverClassName="org.postgresql.Driver"
validationQuery="SELECT 1"
testOnBorrow="true"
url="jdbc:postgresql://localhost:5432/sugarcrm?useUnicode=true&amp;characterEncoding=UTF-
8&amp;autoReconnect=true&amp;autoReconnectForPools=true"/>
<Resource name="jdbc/foodmart" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password"
driverClassName="org.postgresql.Driver"
validationQuery="SELECT 1"
testOnBorrow="true"
url="jdbc:postgresql://localhost:5432/foodmart?useUnicode=true&amp;characterEncoding=UTF-
8&amp;autoReconnect=true&amp;autoReconnectForPools=true"/>
</Context>
4.)Also paste the jdbc connector .jar file mysql-connector-java-5.1.12-bin.jar in the following three
locations:-
i. jasperreports-server-4.1\apache-tomcat\lib
ii. jasperreports-server-4.1\apache-tomcat\webapps\jasperserver-pro\WEB-INF\lib
iii. jasperreports-server-4.1\ireport\ide10\modules\ext

5.)Restart the jasper tomcat services.

You might also like