September 7, 2014

Connecting JasperReport server to Oracle RAC using JDBC

Due to a bug in JasperReport server v4.7, it is not possible to enter JDBC Oracle TNS style descriptor for RAC as a Data Source.  This bug is documented on Jaspersoft Community Forum.

Workaround is as follows:

1) change in JasperServer 4.7 configuration file- validation.properties
example path on Windows server:
C:\Program Files\jasperreports-server-cp-4.7.0\apache-tomcat\webapps\jasperserver\WEB-INF\classes\esapi\validation.properties

# similar to AlphaNumPunctuation, and add space explicitly
# Validator.PathWithSpace=^[\\p{L}\\p{M}\\p{N}\\p{Pd}\\p{Pc}\\p{Po}\\p{Pi}\\p{Pf}\\s\\=\\:\\/\\%\\.\\~\\|]*$

# intead of line above, insert line below
Validator.PathWithSpace=^[\\p{Ps}\\p{Pe}\\p{L}\\p{M}\\p{N}\\p{Pd}\\p{Pc}\\p{Po}\\p{Pi}\\p{Pf}\\s\\=\\:\\/\\%\\.\\~\\|]*$

2) change in JasperServer 4.7 configuration file- security-config.properties
example path on Windows server:
C:\Program Files\jasperreports-server-cp-4.7.0\apache-tomcat\webapps\jasperserver\WEB-INF\classes\esapi\security-config.properties

# change variables to false!
# Turns request parameter validation on or off.
security.validation.input.on=false
# Turns CSRF attack guard on or off.
security.validation.csrf.on=false
# Turns sql validation on or off.
security.validation.sql.on=false

3) login as Tomcat administrator (Tomcat Web Application Manager) and do Reload on application jasperserver (JasperServer UI application)

4) login as JasperReport server administrator and enter new Data Source, now it is possible to enter Oracle TNS style descriptor for RAC in URL field
example:


jdbc:oracle:thin:@(DESCRIPTION=(enable=broken)(load_balance=yes)(address=(protocol=TCP)(host=192.168.0.1)(port=1521))(address=(protocol=TCP)(host=192.168.0.2)(port=1521))(connect_data=(service_name=orcl)(failover_mode=(type=select)(method=basic))))


Links:
http://community.jaspersoft.com/jasperreports-server/issues/2727
http://community.jaspersoft.com/wiki/jaspersoft-security-changes-and-configuration
http://community.jaspersoft.com/wiki/jaspersoft-security-security-configuration-files
http://community.jaspersoft.com/questions/543822/problems-connect-server-using-jdbc-rac

No comments:

Post a Comment